#31661 [Opn->Bgs]: strtotime does not parse dates before 1-1-1970
| From: | sniper@php.net | Date: | Sun, 23 Jan 2005 06:10:37 +0000 |
| Subject: | #31661 [Opn->Bgs]: strtotime does not parse dates before 1-1-1970 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-72687@lists.php.net to get a copy of this message | ||
ID: 31661
Updated by: sniper@php.net
Reported By: gregorylee at contractweb dot net
-Status: Open
+Status: Bogus
Bug Type: Date/time related
Operating System: WinXP
PHP Version: 4.3.8
New Comment:
RTFM: http://www.php.net/strtotime
"Additionally, not all platforms support negative timestamps, therefore
your date range may be limited to no earlier than the Unix epoch. This
means that e.g. dates prior to Jan 1, 1970 will not work on Windows,
some Linux distributions, and a few other operating systems."
Previous Comments:
------------------------------------------------------------------------
[2005-01-23 07:07:12] gregorylee at contractweb dot net
Description:
------------
strtotime still fails (as of version 4.3.8) to appropriately parse
dates prior to 1-1-1970 in Windows builds. Reproducable with dates in
various formats: MM/DD/YYYY, DD/MM/YYYY, YYYY-MM-DD.
Validation/conversion of dates prior to 1970 are frequently needed for
applications that accept user input for birthdates.
Reproduce code:
---------------
print strtotime('04/28/1964');
print strtotime('4/28/64');
print strtotime('1964-04-28');
print strtotime('28/4/1964');
Expected result:
----------------
expect timestamps with the appropriate value (instead of -1);
Actual result:
--------------
-1
-1
-1
-1
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31661&edit=1