#40645 [Csd->Bgs]: strtotime don't work with negative timestamps
| From: | tony2001@php.net | Date: | Tue, 27 Feb 2007 14:42:50 +0000 |
| Subject: | #40645 [Csd->Bgs]: strtotime don't work with negative timestamps | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-109655@lists.php.net to get a copy of this message | ||
ID: 40645
Updated by: tony2001@php.net
Reported By: simone at ivg dot it
-Status: Closed
+Status: Bogus
Bug Type: Date/time related
Operating System: Linux 2.6
PHP Version: 4.4.5
Previous Comments:
------------------------------------------------------------------------
[2007-02-27 14:27:30] simone at ivg dot it
This isn't a PHP bug, but a GNU libc issue.
Here I've found a C code to test if my libc has the problem:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=196177
Thanks.
------------------------------------------------------------------------
[2007-02-26 18:01:02] derick@php.net
This works fine for me with PHP 4.4.6RC2-dev:
<?php
echo strtotime("1951-12-22"), "\n";
?>
-568947600
------------------------------------------------------------------------
[2007-02-26 17:55:41] simone at ivg dot it
Description:
------------
The strtotime() function returns -1 if the date is prior to
1970-01-01.
Instead, date function works properly with negative timestamps.
Reproduce code:
---------------
strtotime("1951-12-22") returns -1
date("d/m/Y",-578944001) returns 28/08/1951
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=40645&edit=1