|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-06-22 20:10 UTC] requinix@php.net
-Type: Bug
+Type: Documentation Problem
[2016-06-22 20:10 UTC] requinix@php.net
[2017-03-19 12:02 UTC] heiglandreas@php.net
-Status: Open
+Status: Not a bug
[2017-03-19 12:02 UTC] heiglandreas@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 10:00:01 2025 UTC |
Description: ------------ modify() doesn't take into account DST changes. For example, if I add 23 hours with DateInterval where a DST change occurs: echo date_default_timezone_get(); // prints Europe/Amsterdam $dateTime = new DateTime('2016-10-29 10:00:00'); $dateTime->add(new DateInterval('PT23H')); I get the expected result: 2016-10-30T08:00:00+01:00 (clock went backwards for 1 hour) But if I add 23 hours with the modify() function on the same date: $dateTime = new DateTime('2016-10-29 10:00:00'); $dateTime->modify('+ 23 hours'); I get: 2016-10-30T09:00:00+01:00 As you see the result here is different. modify() seems to not take into account DST changes. https://3v4l.org/4fncr