From: rbro at hotmail dot com
Operating system: Linux
PHP version: 4.3.9
PHP Bug Type: Date/time related
Bug description: strtotime - crossing daylight savings time
Description:
------------
In the US, Daylight Savings Time ends on October 31, 2004 at 2am where
clocks are then reset back to 1am. I am in the Eastern time zone. If I
run the following script where I'm adding 1 hour, 2 hours, and 3 hours to
the date 2004-10-31, I'm getting different results from including EDT in
the date or not, when I thought that strtotime() defaults to the local
timezone.
Reproduce code:
---------------
<?php
echo date('Y-m-d H:i:s', strtotime('2004-10-31 EDT +1 hour'))."\n";
echo date('Y-m-d H:i:s', strtotime('2004-10-31 EDT +2 hours'))."\n";
echo date('Y-m-d H:i:s', strtotime('2004-10-31 EDT +3 hours'))."\n";
echo "\n";
echo date('Y-m-d H:i:s', strtotime('2004-10-31 +1 hour'))."\n";
echo date('Y-m-d H:i:s', strtotime('2004-10-31 +2 hours'))."\n";
echo date('Y-m-d H:i:s', strtotime('2004-10-31 +3 hours'))."\n";
?>
Expected result:
----------------
2004-10-31 01:00:00
2004-10-31 01:00:00
2004-10-31 02:00:00
2004-10-31 01:00:00
2004-10-31 01:00:00
2004-10-31 02:00:00
Actual result:
--------------
2004-10-31 01:00:00
2004-10-31 01:00:00
2004-10-31 02:00:00
2004-10-31 01:00:00
2004-10-31 02:00:00
2004-10-31 03:00:00
--
Edit bug report at http://bugs.php.net/?id=30532&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30532&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30532&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30532&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=30532&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=30532&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=30532&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=30532&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=30532&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=30532&r=support
Expected behavior: http://bugs.php.net/fix.php?id=30532&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=30532&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=30532&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=30532&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30532&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=30532&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=30532&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=30532&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=30532&r=float
MySQL Configuration Error: http://bugs.php.net/fix.php?id=30532&r=mysqlcfg