#20048 [Com]: mktime() returns -1 for dates < 1970
| From: | jlim at natsoft dot com dot my | Date: | Thu, 27 Feb 2003 06:55:55 +0000 |
| Subject: | #20048 [Com]: mktime() returns -1 for dates < 1970 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-34392@lists.php.net to get a copy of this message | ||
ID: 20048
Comment by: jlim at natsoft dot com dot my
Reported By: jamie at hometownsports dot ca
Status: Wont fix
Bug Type: Unknown/Other Function
Operating System: RedHat Linux 7.3
PHP Version: 4.2.2
New Comment:
As a workaround, you can use the adodb_time library, that uses PHP code
to calculate negative timestamps.
http://php.weblogs.com/adodb_date_time_library
Previous Comments:
------------------------------------------------------------------------
[2002-10-23 15:18:40] hholzgra@php.net
unix timestamp behavior for negative values is undefined
it *may* map to pre-1970 dates but there is no guarantee
whatsoever
------------------------------------------------------------------------
[2002-10-23 14:26:42] jamie at hometownsports dot ca
glibc-2.2.5-34 and greater has been changed to return -1 for dates <
1970. This used to work. The problem exists with RedHat 7.3 and 8.0
echo (mktime(0, 0, 0, 1, 1, 1960)); // prints -1
------------------------------------------------------------------------
[2002-10-23 14:23:48] jamie at hometownsports dot ca
glibc-2.2.5-34 and greater has been changed to return -1 for dates <
1970. This used to work. The problem exists with RedHat 7.3 and 8.0
echo (mktime(0, 0, 0, 1, 1, 1960)); // prints -1
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=20048&edit=1