note 37947 added to function.strtotime
| From: | webmaster at at at 20k at dot at de dot php dot net | Date: | Wed, 03 Dec 2003 01:27:18 +0000 |
| Subject: | note 37947 added to function.strtotime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-61299@lists.php.net to get a copy of this message | ||
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
----
Manual Page -- http://www.php.net/manual/en/function.strtotime.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+37947
Delete -- http://master.php.net/manage/user-notes.php?action=delete+37947&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+37947&report=yes
Search -- http://master.php.net/manage/user-notes.php