|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-10-22 16:13 UTC] sam at strictlyphp dot com
[2016-03-30 08:15 UTC] marc dot fricou at iadvize dot com
[2016-09-29 17:53 UTC] cmb@php.net
-Status: Open
+Status: Verified
-Package: *General Issues
+Package: Date/time related
[2016-09-29 17:53 UTC] cmb@php.net
[2017-03-19 11:37 UTC] heiglandreas@php.net
-Status: Verified
+Status: Duplicate
[2017-03-19 11:37 UTC] heiglandreas@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 13:00:01 2025 UTC |
Description: ------------ Starting with a date in standard time and subtracting over the DST "border", suddenly adds time. Line 5 in the actual result below seems to be wrong. Happens in all PHP versions from 5.4.24 & 5.5.8 onwards. Test script: --------------- $tz = new DateTimeZone('Europe/Brussels'); $date = new DateTime('2014-10-26T03:00:00', $tz); $interval = new DateInterval('PT30M'); for ($i = 0; $i < 5; $i++) { echo $date->sub($interval)->format('c e T') . PHP_EOL; } Expected result: ---------------- 2014-10-26T02:30:00+01:00 Europe/Brussels CET 2014-10-26T02:00:00+01:00 Europe/Brussels CET 2014-10-26T02:30:00+02:00 Europe/Brussels CEST 2014-10-26T02:00:00+02:00 Europe/Brussels CEST 2014-10-26T01:30:00+02:00 Europe/Brussels CEST Actual result: -------------- 2014-10-26T02:30:00+01:00 Europe/Brussels CET 2014-10-26T02:00:00+01:00 Europe/Brussels CET 2014-10-26T02:30:00+02:00 Europe/Brussels CEST 2014-10-26T02:00:00+02:00 Europe/Brussels CEST 2014-10-26T02:30:00+02:00 Europe/Brussels CEST