Bug #73460 [NEW]: Datetime add not realising it already applied DST change
From: saulyx at gmail dot com
Operating system: FreeBSD
PHP version: 5.6Git-2016-11-04 (Git)
Package: Date/time related
Bug Type: Bug
Bug description:Datetime add not realising it already applied DST change
Description:
------------
PHP seems to run into an infinite loop when add() is run and it adjusts
to the DST change, but when it arrives at the time again, it reset back
an hour for infinite amount of times.
Test script:
---------------
$date = new DateTime('2016-11-05 22:00:00', new
DateTimeZone('America/New_York'));
foreach(range(1,48) as $i) {
echo $date->format('Y/m/d H:i')."<br/>";
$date->add(new DateInterval('PT15M'));
}
Actual result:
--------------
2016/11/05 22:00
2016/11/05 22:15
2016/11/05 22:30
2016/11/05 22:45
2016/11/05 23:00
2016/11/05 23:15
2016/11/05 23:30
2016/11/05 23:45
2016/11/06 00:00
2016/11/06 00:15
2016/11/06 00:30
2016/11/06 00:45
2016/11/06 01:00
2016/11/06 01:15
2016/11/06 01:30
2016/11/06 01:45
2016/11/06 01:00
2016/11/06 01:15
2016/11/06 01:30
2016/11/06 01:45
2016/11/06 01:00
2016/11/06 01:15
2016/11/06 01:30
2016/11/06 01:45
2016/11/06 01:00
2016/11/06 01:15
2016/11/06 01:30
2016/11/06 01:45
2016/11/06 01:00
2016/11/06 01:15
2016/11/06 01:30
2016/11/06 01:45
2016/11/06 01:00
2016/11/06 01:15
2016/11/06 01:30
2016/11/06 01:45
2016/11/06 01:00
2016/11/06 01:15
2016/11/06 01:30
2016/11/06 01:45
2016/11/06 01:00
2016/11/06 01:15
2016/11/06 01:30
2016/11/06 01:45
2016/11/06 01:00
2016/11/06 01:15
2016/11/06 01:30
2016/11/06 01:45
--
Edit bug report at https://bugs.php.net/bug.php?id=73460&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=73460&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=73460&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=73460&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=73460&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=73460&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=73460&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=73460&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=73460&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=73460&r=support
Expected behavior: https://bugs.php.net/fix.php?id=73460&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=73460&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=73460&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=73460&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=73460&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=73460&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=73460&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=73460&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=73460&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=73460&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=73460&r=mysqlcfg
Thread (4 messages)
- saulyx at gmail dot com