Re: Re: DATE FORMAT ISSUES
| From: | Beeman | Date: | Mon, 22 Oct 2001 16:33:42 +0000 |
| Subject: | Re: Re: DATE FORMAT ISSUES | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-71845@lists.php.net to get a copy of this message | ||
That worked. Thanks a lot... You rock
-Beeman
"Rasmus Lerdorf" <rasmus@php.net> wrote in message
news:Pine.LNX.4.33.0110220925070.17431-100000@rasmus.php.net...
> > Yeah, I select it using UNIX_TIMESTAMP(creation_datetime) and then I am
> > using date("M d, Y g:ia",$myrow["creation_datetime"]) at the end of a
printf
> > statement but the date comes back as Dec 31 1969 7:00pm for all entries.
> > When the date was inserted I used now() in the insert statement.
>
> You should be doing:
>
> select UNIX_TIMESTAMP(creation_datetime) as foo
>
> date("M d, Y g:ia",$myrow['foo'])
>
> -Rasmus
>
> > "Rasmus Lerdorf" <rasmus@php.net> wrote in message
> >
> > news:Pine.LNX.4.33.0110220906420.17431-100000@rasmus.php.net...
> > > Are you retrieving it using MySQL's UNIX_TIMESTAMP() function? PHP's
> > > date() function needs a unix timestamp to work with.
> > >
> > > -Rasmus
> > >
> > > On Mon, 22 Oct 2001, Beeman wrote:
> > >
> > > > No it is definitely a DATETIME and the date and time are correct in
the
> > > > database, but when I try to format and display them the date is
correct
> > but
> > > > the time is not
> > > > "_lallous" <elias_bachaalany@yahoo.com> wrote in message
> > > > news:20011022140057.21068.qmail@pb1.pair.com...
> > > > > maybe you have in your database a DATE field instead of DATETIME
> > field?
> > > > >
> > > > > "Beeman" <dbh3@mac.com> wrote in message
> > > > >
> > > > > news:20011022134511.14775.qmail@pb1.pair.com...
> > > > > > I have inserted the date into MySQL using now() in the query.
> > However,
> > > > > when
> > > > > > I retrieve the using MySQL_Date_Format in the query the time is
> > always
> > > > > > wrong. on the other hand, if I format the date using Date() in
PHP
> > it
> > > > > always
> > > > > > makes the date DEC 31 1969 at 700PM. Please Help
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > >
> > > >
> > >
> >
> >
> >
> >
>