RE: [PHP] date() thinks it's 1942

From: Date: Thu, 03 Aug 2000 11:13:12 +0000
Subject: RE: [PHP] date() thinks it's 1942
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-9905@lists.php.net to get a copy of this message
> Hi. I'm trying to use date() to format a 14 digit time stamp, > and it's going > crazy. For timestamps from yesterday, it's giving me 5th > October 1942. I've > echoed the actual timestamp, and that's correct, it's just > what date() is > doing to the data that is wrong. > > I've RTFM and TFArchives as well, and can't see anything > about this. Can > anyone tell me what's happening? The smallest 14 digit timestamp in the format that date() uses gives me approx 317,000 years after 1970. Presumably this is not quite what you're after. Are you by any chance using a timestamp in the format DDMMYYYYHHMMSS (or similar)? If this is so then it's wrong. The date() function uses a timestamp in the format returned by the time() function, or the mktime() function. ie number of seconds elapsed since midnight 1st Jan 1970. -- Richard Heyes http://www.heyes-computing.net/scripts/ Plain text email only please!

« previous php.general (#9905) next »