|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2018-06-30 09:30 UTC] requinix@php.net
-Status: Open
+Status: Not a bug
[2018-06-30 09:30 UTC] requinix@php.net
[2018-06-30 10:42 UTC] learncomp at mail dot ru
[2018-06-30 10:59 UTC] requinix@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 21:00:01 2025 UTC |
Description: ------------ Europe/Oslo has DST and it occurs at (got with `(new DateTimeZone("Europe/Oslo"))->getTransitions()`): ``` [ "ts" => 1521939600, "time" => "2018-03-25T01:00:00+0000", "offset" => 7200, "isdst" => true, "abbr" => "CEST", ], [ "ts" => 1540688400, "time" => "2018-10-28T01:00:00+0000", "offset" => 3600, "isdst" => false, "abbr" => "CET", ], ``` The following test script increments the input date time to 1 hour which should not occur?. I'm not sure either this is a bug or not as I don't have enough information to decide but probably it can be the bug. Test script: --------------- <?php // For the start date time + 1 hour it prints 2018-03-25 03:00:00, which is incorrect? echo (new \DateTimeImmutable('2018-03-25 02:00:00', new \DateTimeZone('Europe/Oslo')))->format('Y-m-d H:i:s'); // However for the end date time it does not change the value, tried for the dates: "2018-10-27 23:00:00", "2018-10-28 00:00:00", "2018-10-28 01:00:00", "2018-10-28 02:00:00", "2018-10-28 03:00:00", "2018-10-28 04:00:00", "2018-10-28 05:00:00", "2018-10-28 06:00:00" like so: // echo (new \DateTimeImmutable('2018-10-28 03:00:00', new \DateTimeZone('Europe/Oslo')))->format('Y-m-d H:i:s'); // It always returns the same value, which I think is correct. Expected result: ---------------- 2018-03-25 02:00:00 Actual result: -------------- 2018-03-25 03:00:00