#45647 [Opn->Bgs]: strtotime() returning 1999-11-30 for 00-00-00 00:00:00
| From: | derick@php.net | Date: | Mon, 28 Jul 2008 19:17:56 +0000 |
| Subject: | #45647 [Opn->Bgs]: strtotime() returning 1999-11-30 for 00-00-00 00:00:00 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-127352@lists.php.net to get a copy of this message | ||
ID: 45647
Updated by: derick@php.net
Reported By: jon dot reed at jellyfish dot co dot uk
-Status: Open
+Status: Bogus
Bug Type: Date/time related
Operating System: Centos 5.1
PHP Version: 5.2.6
New Comment:
There is no bug here, 00-00-00 means 2000-00-00, which is 1999-12-00,
which is 1999-11-30. No bug, perfectly normal.
Previous Comments:
------------------------------------------------------------------------
[2008-07-28 16:40:58] jon dot reed at jellyfish dot co dot uk
Description:
------------
As per bug #41523 which is reported fixed on Vista.
We're running a custom build RPM of 5.2.6
It looks like this bug has reappeared:
$incorrect = '1999-11-30';
$time = date('Y-m-d',strtotime('00-00-00 00:00:00'));
$this->assertNotEqual($time, $incorrect);
This fails SimpleTest.
php -r "echo date('Y-m-d',strtotime('00-00-00 00:00:00'));"
1999-11-30
Reproduce code:
---------------
echo strtotime('00-00-00 00:00:00');
Expected result:
----------------
-1
Actual result:
--------------
943920000
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=45647&edit=1