Re: Problems reformatting Unix timestamp with strftime
| From: | eschmid+sic at s dot netic dot de | Date: | Fri, 16 Feb 2001 00:08:58 +0000 |
| Subject: | Re: Problems reformatting Unix timestamp with strftime | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-40006@lists.php.net to get a copy of this message | ||
On Fri, Feb 16, 2001 at 12:04:01AM +0000, Steven Hirschorn wrote:
> I've checked this in the PHP documentation and done a scan of the
> archive to try to work out where I am going wrong but have failed. I
> know I could fix this problem by using substrings and processing them,
> but PHP has a simpler function which should work. Shouldn't it?
>
> In my database a record has a timestamp of:
> 20010213173654
>
> I extract the timestamp with a select statement, and process it with:
>
> strftime("%A, %e %B %Y", $lastmodified) (where lastmodified is the
> variable containing the timestamp)
>
> and it produces the output:
> Monday, 18 January 2038
>
> Does anyone know why PHP isn't interpreting the timestamp correctly? I
> can't work out how it could misinterpret the timestamp like this...
You haven't read the PHP Manual carefully:
http://php.net/mktime
http://php.net/date
-Egon
--
http://www.linuxtag.de/
http://php.net/books.php
http://www.concert-band.de/
http://www.php-buch.de/