#25598 [Opn->Csd]: strtotime can't handle dates before 1970, and the documentation doesn't say it.
| From: | didou@php.net | Date: | Wed, 19 Nov 2003 13:01:05 +0000 |
| Subject: | #25598 [Opn->Csd]: strtotime can't handle dates before 1970, and the documentation doesn't say it. | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969356976@lists.php.net to get a copy of this message | ||
ID: 25598
Updated by: didou@php.net
Reported By: bens at benjamindsmith dot com
-Status: Open
+Status: Closed
Bug Type: Documentation problem
Operating System: 2.4.x Linux, Windows
PHP Version: 4.3.2
New Comment:
Fixed in CVS :)
Hartmut, this was mentionned in strftime() but too specific to make an
entity.
Previous Comments:
------------------------------------------------------------------------
[2003-10-13 05:30:29] hholzgra@php.net
UNIX timestamps for dates before Jan 1st 1970 are undefined anyway
some platforms treat negative timestamps as dates before 1970 while
others just consider negative values as undefined ... so this is a
'won't fix' problem unless we come up with a portable PHP C-lib ;)
AFAIR this *is* documented in other places in the manual?
------------------------------------------------------------------------
[2003-09-18 17:57:42] bens at benjamindsmith dot com
Description:
------------
No matter what I do, strtotime can't seem to handle dates prior to
1970. The answer returned is always -1.
The manual doesn't indicate this fact.
Reproduce code:
---------------
echo phpversion();
echo "\n------------------\n";
$time1="1/1/1970";
$time2="31-dec-1969";
$time3="31-dec-1949";
echo strtotime($time1);
echo "\n";
echo strtotime($time2);
echo "\n";
echo strtotime($time3);
echo "\n";
Expected result:
----------------
4.3.2
-----------------
28800
-{some integer other than 1}
-{some bigger integer other than 1}
Actual result:
--------------
4.3.2
------------------
28800
-1
-1
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=25598&edit=1