Edit report at https://bugs.php.net/bug.php?id=62561&edit=1
ID: 62561 Updated by: s...@php.net Reported by: zach dot bailey at pardot dot com Summary: DateTime add 'P1D' adds 25 hours -Status: Open +Status: Closed Type: Bug Package: Date/time related Operating System: Mac OS X 10.7.4 PHP Version: 5.3.14 -Assigned To: +Assigned To: stas Block user comment: N Private report: N New Comment: The fix for this bug has been committed. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. For Windows: http://windows.php.net/snapshots/ Thank you for the report, and for helping us make PHP better. merged into 5.4 Previous Comments: ------------------------------------------------------------------------ [2012-09-30 04:34:54] lonnyk at gmail dot com A potential fix is available https://github.com/php/php-src/pull/210 ------------------------------------------------------------------------ [2012-09-30 00:50:22] lonnyk at gmail dot com This seems to be related to bug #62896 ------------------------------------------------------------------------ [2012-09-29 02:32:09] lonnyk at gmail dot com This bug is the result of the fix for bug #55253 and bug #60236 ------------------------------------------------------------------------ [2012-08-17 14:00:54] adam at lundrigan dot ca Confirmed using PHP 5.3.16 (compiled from src) on RHEL 5.8 Failing PHPT test: https://github.com/adamlundrigan/php-src/blob/409bf5d888869aa2889d910af1b8edfe159febae/ext/date/tests/bug62561.phpt ------------------------------------------------------------------------ [2012-07-13 21:41:27] zach dot bailey at pardot dot com Description: ------------ When a DateTime is constructed with a non-UTC timezone and one day is added, the time also jumps forward by an hour as well. Test script: --------------- $ts = new DateTime('@1341115200', new DateTimeZone('America/New_York')); $dayFromTs = new DateTime('@1341115200', new DateTimeZone('America/New_York')); $dayFromTs->add(new DateInterval('P1D')); echo 'ts: '.$ts->format('Y-m-d H:i:s')."\n"; echo 'day from ts: '.$dayFromTs->format('Y-m-d H:i:s')."\n"; Expected result: ---------------- ts: 2012-07-01 04:00:00 day from ts: 2012-07-02 04:00:00 Actual result: -------------- ts: 2012-07-01 04:00:00 day from ts: 2012-07-02 05:00:00 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=62561&edit=1