Bug #65811 [NEW]: Invalid hour returned on DST change
| From: | glavic at gmail dot com | Date: | Wed, 02 Oct 2013 11:32:12 +0000 |
| Subject: | Bug #65811 [NEW]: Invalid hour returned on DST change | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-181955@lists.php.net to get a copy of this message | ||
From: glavic at gmail dot com
Operating system: ALL
PHP version: Irrelevant
Package: Date/time related
Bug Type: Bug
Bug description:Invalid hour returned on DST change
Description:
------------
If I currently have datetime in DST, and then add some interval to that
date (to skip DST), invalid datetime is returned.
How it is: 2013-10-27 01:45 (in DST) + 30 min = 02:15 (not in DST)
How it should be: 2013-10-27 01:45 (in DST) + 30 min = 01:15 (not in
DST)
Same for all php versions about >= 5.2.0 : http://3v4l.org/DUO06
Test script:
---------------
$tz = new DateTimezone('Europe/Berlin'); # uses DST
$dt = new DateTime('2013-10-27 01:45:00', $tz);
echo $dt->format('Y-m-d H:i I') . "\n";
$dt->modify("+30 minute");
echo $dt->format('Y-m-d H:i I') . "\n";
Expected result:
----------------
2013-10-27 01:45 1
2013-10-27 01:15 0
Actual result:
--------------
2013-10-27 01:45 1
2013-10-27 02:15 0
--
Edit bug report at https://bugs.php.net/bug.php?id=65811&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=65811&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=65811&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=65811&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=65811&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=65811&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=65811&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=65811&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=65811&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=65811&r=support
Expected behavior: https://bugs.php.net/fix.php?id=65811&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=65811&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=65811&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=65811&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=65811&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=65811&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=65811&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=65811&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=65811&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=65811&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=65811&r=mysqlcfg