From:
Operating system: Linux and MacOSX
PHP version: 5.3.3
Package: Date/time related
Bug Type: Bug
Bug description:Some relative date/time format returns incorrect result at the
end of DST
Description:
------------
Relative date/time format '+[number]sec', '+[number]min', '+[number]hour'
returns incorrect time when the current time is in daylight saving time and
the result of calculation is non-daylight saving time.
For example, daylight saving time of this year in the USA was started at
2010-03-14 02:00:00, and finished at 2010-11-07 02:00:00. However,
'2010-11-07 01:59:59 +1sec' advance to 3601 sec after.
Test script:
---------------
<?php
date_default_timezone_set('America/Los_Angeles');
echo date("c", strtotime("2010-03-14 01:59:59")) . PHP_EOL;
echo date("c", strtotime("2010-03-14 01:59:59 +1sec")) . PHP_EOL;
echo date("c", strtotime("2010-11-07 01:59:59")) . PHP_EOL;
echo date("c", strtotime("2010-11-07 01:59:59 +1sec")) . PHP_EOL;
Expected result:
----------------
2010-03-14T01:59:59-08:00
2010-03-14T03:00:00-07:00
2010-11-07T01:59:59-07:00
2010-11-07T01:00:00-08:00
Actual result:
--------------
2010-03-14T01:59:59-08:00
2010-03-14T03:00:00-07:00
2010-11-07T01:59:59-07:00
2010-11-07T02:00:00-08:00
--
Edit bug report at http://bugs.php.net/bug.php?id=53370&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=53370&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=53370&r=trysnapshot53
Try a snapshot (trunk):
http://bugs.php.net/fix.php?id=53370&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=53370&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=53370&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=53370&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=53370&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=53370&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=53370&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=53370&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=53370&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=53370&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=53370&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=53370&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53370&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=53370&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=53370&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=53370&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=53370&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=53370&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=53370&r=mysqlcfg