Page 1 of 1

Outputting Date

Posted: Mon Apr 10, 2006 3:52 am
by sampage
In my database I have a user_lastlogin which is stored as a datetime value. i.e. 0000-00-00 00:00:00

When I echo this date for example like this:

Code: Select all

....
$user_lastlogin = $myrow['user_lastlogin'];

echo $user_lastlogin;
How do I control the output so that it is displayed time - date?

Posted: Mon Apr 10, 2006 4:10 am
by phpScott
date_format on the db side of things is probably easiest.
Find date_format on this page http://dev.mysql.com/doc/refman/4.1/en/ ... tions.html