Re: Problems reformatting Unix timestamp with strftime
| From: | Rog | Date: | Fri, 16 Feb 2001 01:57:43 +0000 |
| Subject: | Re: Problems reformatting Unix timestamp with strftime | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-40057@lists.php.net to get a copy of this message | ||
eschmid+sic@s.netic.de wrote:
Your timestamp looks bogus. On normal systems this can only be a 32 bit integer and there will be an overflow at that time.His timestamp is perfectly fine, it's just in the wrong format. His is formatted to YearMonthDayHourMinuteSecond and you (and the date function for that matter) are assuming a UNIX timestamp of seconds since 1970. He's probably gotten his timestamp from a database, in which case the easiest solution is usually reformat the timestamp when collecting it from the database rather than within PHP. (MySQL) Example : select UNIX_TIMESTAMP(timestamp); Then the timestamp will be properly formatted for PHP's date command. --
Visit the Gates Motel webgame:
http://www.gameslate.com/gatesmotel/