Edit report at http://bugs.php.net/bug.php?id=54124&edit=1
ID: 54124
Comment by: tomas dot brastavicius at quantum dot lt
Reported by: tomas dot brastavicius at quantum dot lt
Summary: strtotime() returns invalid timestamp with DST
transition at new year midnight
Status: Bogus
Type: Bug
Package: Date/time related
Operating System: Ubuntu
PHP Version: 5.3.6RC1
Block user comment: N
Private report: N
New Comment:
Sorry, I used not so reliable TZ data source.
Previous Comments:
------------------------------------------------------------------------
[2011-03-01 02:41:35] [email protected]
Vilnius didn't observe have any time changes in 2002 (or until 30 March
2003) and
Baku didn't observe any changes in 1995 (or until 31 March 1996). The
output is
correct.
[1]
http://www.timeanddate.com/worldclock/timezone.html?n=660&syear=2000
[2]
http://www.timeanddate.com/worldclock/timezone.html?n=369&syear=1990
[3] http://en.wikipedia.org/wiki/Tz_database
------------------------------------------------------------------------
[2011-02-28 21:57:15] tomas dot brastavicius at quantum dot lt
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 this bug report at http://bugs.php.net/bug.php?id=54124&edit=1