Jump to content


Photo

php date format


  • Please log in to reply
2 replies to this topic

#1 CanMan2004

CanMan2004
  • Members
  • PipPipPip
  • Advanced Member
  • 254 posts

Posted 01 June 2006 - 11:33 AM

Hi all

I have a coloum in my db called "expires" whichb stores a date stamp in the format

YYYY-MM-DD

I then print this date using

<? print $rows['expires'];?>

when I print the above, it prints an output like

2006-01-04

how can I get php to format the date and display it as

04-01-2006

so its printing in the format

DD-MM-YYYY

Can anyone help?

Thanks in advance

Ed

#2 litebearer

litebearer
  • Members
  • PipPipPip
  • Advanced Member
  • 2,357 posts
  • Locationwhite lake michigan

Posted 01 June 2006 - 11:47 AM

look at this thread

[a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=71665\" target=\"_blank\"]http://www.phpfreaks.com/forums/index.php?showtopic=71665[/a]

Lite...

all the brothers were valiant!

[br][br]The truely intelligent people are not those who create the dots; rather they are they ones with the ability to connect the dots into a coherent picture

#3 localhost

localhost
  • Members
  • PipPipPip
  • Advanced Member
  • 152 posts

Posted 01 June 2006 - 12:09 PM

Well, date can be done in many different ways....


d = day
m = month
y = year

echo date('m/d/y'); = 6/1/06

echo date('m/d/Y'); = 6/1/2006




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users