Bug #72398 [Asn->Dup]: DST issue

From: Date: Sun, 19 Mar 2017 12:00:45 +0000
Subject: Bug #72398 [Asn->Dup]: DST issue
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-207955@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=72398&edit=1 ID: 72398 Updated by: heiglandreas@php.net Reported by: matthieuxdekamen at gmail dot com Summary: DST issue -Status: Assigned +Status: Duplicate Type: Bug Package: Date/time related PHP Version: 7.1.0alpha1 Assigned To: derick 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-06-13 19:48:18] matthieuxdekamen at gmail dot com Description: ------------ In Netherland's timezone (GMT+1/+2), if I add 23 hours to 29 October 2016 10 o'clock, I get 30 October 8 o'clock because we moved the clock 1 hour backwards. But when I add 23 hours to 26 March 2016 10 o'clock, why don't I get 10 o'clock as we moved the clock one hour forward? Instead, I obtain 9 o'clock (as no DST change occured). See here: https://3v4l.org/uXf8d Test script: --------------- echo date_default_timezone_get(); // prints Europe/Amsterdam echo "\n\n"; $dateTime = new DateTime('2016-10-29 10:00:00'); // back one hour echo $dateTime->format(DateTime::RFC3339); echo "\n"; $dateTime->add(new DateInterval('PT23H')); echo $dateTime->format(DateTime::RFC3339); // prints 2016-10-30T08:00:00+01:00 echo "\n\n"; $dateTime = new DateTime('2016-03-26 10:00:00'); // forward one hour echo $dateTime->format(DateTime::RFC3339); echo "\n"; $dateTime->add(new DateInterval('PT23H')); echo $dateTime->format(DateTime::RFC3339); // prints 2016-03-27T09:00:00+02:00 (expected 10 o'clock) echo "\n\n"; $dateTime = new DateTime('2016-05-26 10:00:00'); // no DST change echo $dateTime->format(DateTime::RFC3339); echo "\n"; $dateTime->add(new DateInterval('PT23H')); echo $dateTime->format(DateTime::RFC3339); // prints 2016-05-27T09:00:00+02:00 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=72398&edit=1

« previous php.bugs (#207955) next »