ID: 25598
Updated by: [EMAIL PROTECTED]
Reported By: bens at benjamindsmith dot com
Status: Open
Bug Type: Documentation problem
Operating System: 2.4.x Linux, Windows
PHP Version: 4.3.2
New Comment:
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?
Previous Comments:
------------------------------------------------------------------------
[2003-10-10 16:25:45] thom at ourclubonline dot com
Same problem on PHP 4.3.2 on Linux 2.2.1.
------------------------------------------------------------------------
[2003-09-22 16:38:30] wjs at sympatico dot ca
works on php 4.3.2, linux 2.4
not on php 4.3.3, linux 2.4 (rh 9.-0)
------------------------------------------------------------------------
[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