Jump to content

Archived

This topic is now archived and is closed to further replies.

CanMan2004

php date format

Recommended Posts

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

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.