note 37947 deleted from function.strtotime by aidan

From: Date: Wed, 11 Aug 2004 18:22:32 +0000
Subject: note 37947 deleted from function.strtotime by aidan
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-74487@lists.php.net to get a copy of this message
Note Submitter: webmaster @at@ 20k @dot@ de ---- strtotime() only works reliable arround the current date without implementation side-effects, it looks like this is currently the area *1970-01-01* to *2038-01-19* (dates in ISO format without *. The german PHP online manual says, it should work from 1901-12-14 without problem, which is not true). After transferring some scripts which used strtotime() from one computer (SuSE 8.0) to another one (RedHat 9.0) I stumbled over the fact, that for my birthday getdate(strtotime("1967-03-07")) failed suddenly (garbage output). This was because strtotime() returnes -1 for dates before 1970-01-01, however this somehow worked without problem on the old system (I looked into the PHP manual of time(), so I really wonder how it worked before). From the GNU documentation of date input formats: "Although the date syntax here can represent any possible time since zero A.D., computer integers are not big enough for such a (comparatively) long time. The earliest date semantically allowed on Unix systems is midnight, 1 January 1970 UCT." -Tino

« previous php.notes (#74487) next »