|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72398 DST issue
Submitted: 2016-06-13 19:48 UTC Modified: 2017-03-19 12:00 UTC
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: matthieuxdekamen at gmail dot com Assigned: derick (profile)
Status: Duplicate Package: Date/time related
PHP Version: 7.1.0alpha1 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
33 + 14 = ?
Subscribe to this entry?

 [2016-06-13 19:48 UTC] matthieuxdekamen at gmail dot com
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:

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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-06-14 05:32 UTC]
-Assigned To: +Assigned To: derick
 [2017-03-19 12:00 UTC]
-Status: Assigned +Status: Duplicate
 [2017-03-19 12:00 UTC]
We're now tracking this in
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Apr 20 16:01:23 2021 UTC