Bug #65811 [Opn->Dup]: Invalid hour returned on DST change
Edit report at https://bugs.php.net/bug.php?id=65811&edit=1
ID: 65811
Updated by: heiglandreas@php.net
Reported by: glavic at gmail dot com
Summary: Invalid hour returned on DST change
-Status: Open
+Status: Duplicate
Type: Bug
Package: Date/time related
Operating System: ALL
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
We're now tracking this in https://bugs.php.net/bug.php?id=74274
Previous Comments:
------------------------------------------------------------------------
[2016-07-17 21:43:02] mark at mpen dot ca
Confirmed this is still an issue in PHP 7.0.5.
I've had to convert my dates to UTC and then back again to avoid this bug. Please fix.
------------------------------------------------------------------------
[2013-10-02 11:32:12] glavic at gmail dot com
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 this bug report at https://bugs.php.net/bug.php?id=65811&edit=1
Thread (3 messages)