From:
Operating system: Ubuntu
PHP version: 5.3.6RC1
Package: Date/time related
Bug Type: Bug
Bug description:strtotime() returns invalid timestamp with DST transition at
new year midnight
Description:
------------
strtotime() returns invalid timestamp with DST transition at new year
midnight
Test script:
---------------
date_default_timezone_set("Europe/Vilnius");
echo date("Y-m-d H:i:s", strtotime("2002-12-31 23:59:59 +1 sec")) . "\n";
date_default_timezone_set("Asia/Baku");
echo date("Y-m-d H:i:s", strtotime("1995-12-31 23:59:59 +1 sec")) . "\n";
date_default_timezone_set("Africa/Cairo");
echo date("Y-m-d H:i:s", strtotime("2010-09-09 23:59:59 +1 sec")) . "\n";
// OK
date_default_timezone_set("Asia/Karachi");
echo date("Y-m-d H:i:s", strtotime("2009-04-14 23:59:59 +1 sec")) . "\n";
// OK
Expected result:
----------------
2003-01-01 01:00:00
1996-01-01 01:00:00
2010-09-10 01:00:00
2009-04-15 01:00:00
Actual result:
--------------
2003-01-01 00:00:00
1996-01-01 00:00:00
2010-09-10 01:00:00
2009-04-15 01:00:00
--
Edit bug report at http://bugs.php.net/bug.php?id=54124&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=54124&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=54124&r=trysnapshot53
Try a snapshot (trunk):
http://bugs.php.net/fix.php?id=54124&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=54124&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=54124&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=54124&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=54124&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=54124&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=54124&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=54124&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=54124&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=54124&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=54124&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=54124&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=54124&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=54124&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=54124&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=54124&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=54124&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=54124&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=54124&r=mysqlcfg