Re: display date
| From: | Ignacio Vazquez-Abrams | Date: | Sun, 17 Dec 2000 21:24:57 +0000 |
| Subject: | Re: display date | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-30766@lists.php.net to get a copy of this message | ||
On Sun, 17 Dec 2000 wooik@halfmind.com wrote:
> Before I asked my question, just want to let you all know that I did look
> up the manual to find the answer, but can't seem to find it.
>
> Anyway, the problem that I have: I have a postgres database the returns a
> datetime field. I want to display it as MMM DD, YYYY (e.g. Nov 15, 2000),
> The following is what I have
>
> <?php echo date("M d, Y", $r[4]); ?> <== $r[4] contains Dec 16, 2000
>
> but what I got back is "Dec 31, 1969".
>
> Am I missing something again??
>
> wooi.
> p/s Brain, if you are reading this email, just want to thank you for
> answering me my previous question :-) But I did try to find the answer in
> the php manual and some other php sites.
>
It's probably because the datetime looks like a string to PHP, and PHP
converts strings that don't start with a number into 0.
--
Ignacio Vazquez-Abrams <ignacio@openservices.net>