From: asylow at free dot fr Operating system: windows XP PHP version: 5.2.9 PHP Bug Type: Date/time related Bug description: summer hour withda date object
Description: ------------ Hi, When adding +2 hours to '2009-10-25 01:00:00', '03:00:00' is obtained, skipping the second '02:00:00' that exists during that night. Reproduce code: --------------- Comparison between using +1 hour to the object and adding +3600 to the timestamp : <?php $date1 = '2009-10-25 01:00:00'; $obj_date = date_create($date1); $timestamp = strtotime($date1); $timestamp += 3600; $obj_date->modify('+1 hour'); echo '+1 hour<br>'; echo 'timestamp : ' . date('H:i:s',$timestamp) . ' ' . $timestamp . '<br/>'; echo 'date_obj : ' . $obj_date->format('H:i:s') . ' ' . $obj_date->format('U') . '<br><br>'; echo '+2 hours<br>'; $timestamp += 3600; $obj_date->modify('+1 hour'); echo 'timestamp : ' . date('H:i:s',$timestamp) . ' ' . $timestamp . '<br/>'; echo 'date_obj : ' . $obj_date->format('H:i:s') . ' ' . $obj_date->format('U') . '<br><br>'; ?> Expected result: ---------------- +1 hour timestamp : 02:00:00 1256428800 date_obj : 02:00:00 1256432400 +2 hours timestamp : 02:00:00 1256432400 date_obj : 02:00:00 1256432400 Actual result: -------------- +1 hour timestamp : 02:00:00 1256428800 date_obj : 02:00:00 1256432400 +2 hours timestamp : 02:00:00 1256432400 date_obj : 03:00:00 1256436000 -- Edit bug report at http://bugs.php.net/?id=47909&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=47909&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=47909&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=47909&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=47909&r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=47909&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=47909&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=47909&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=47909&r=needscript Try newer version: http://bugs.php.net/fix.php?id=47909&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=47909&r=support Expected behavior: http://bugs.php.net/fix.php?id=47909&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=47909&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=47909&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=47909&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=47909&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=47909&r=dst IIS Stability: http://bugs.php.net/fix.php?id=47909&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=47909&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=47909&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=47909&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=47909&r=mysqlcfg