Re: Date() Problem
| From: | Tony Harrison | Date: | Sat, 27 Jul 2002 09:36:29 +0000 |
| Subject: | Re: Date() Problem | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-109949@lists.php.net to get a copy of this message | ||
Yeh, ive allready looked at that before, but where and when do i use
DATE_FORMAT() ? When im inserting the row or selecting it?
"Jome" <jome@emoj.net> wrote in message
news:20020727093525.8534.qmail@pb1.pair.com...
> > Hi, im making a tab/lyric portal, and for viewing tabs i want to display
> the
> > time the lyric/tab was submitted. So I retrive it from a MySQL database
> (as
> > a timestamp) and format it using the date function. The problem is, that
> the
> > 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().
>
> Regards,
>
> Jome
>
>