> Hi, im making a tab/lyric portal, and for viewing tabs i want to display
> time the lyric/tab was submitted. So I retrive it from a MySQL database
> a timestamp) and format it using the date function. The problem is, that
> date: 19-01-2038 04:14:07 is allways returned, even though in the `date`
> field the timestamp says (as an actual example) 20020723200919.
> Here is a shortened version of the script:
> <?php $submitdate = date("d-m-Y H:i:s", $values[4]); echo("Submitted on
> $submitdate"); ?>

Hi Tony,

the date() function in PHP does _only_ take UNIX timestamps as an argument
which means that you can not run such a timestamp as the above.

I recommend that you have a look at
http://www.mysql.com/doc/D/a/Date_and_time_functions.html which describes
the built-in functions for date-handling in MySQL. A function to look at
could be DATE_FORMAT().



PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to