|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52152 DST detection works wrong with late dates (TS over int32)
Submitted: 2010-06-23 07:29 UTC Modified: 2017-01-11 08:31 UTC
Avg. Score:3.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (50.0%)
From: danikas2k2 at gmail dot com Assigned:
Status: Wont fix Package: Date/time related
PHP Version: 5.3.2 OS: Ubuntu i686 2.6.32-22-generic
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 — but make sure to vote on the bug!
Your email address:
Solve the problem:
21 - 9 = ?
Subscribe to this entry?

 [2010-06-23 07:29 UTC] danikas2k2 at gmail dot com
DST detection for late dates (timestamp over int32)

Test script:
$date = new DateTime('2020-05-25 12:00:00', new DateTimeZone('Europe/Warsaw'));
echo $date->format(DateTime::ATOM), ' ', $date->format('I U');

$date = new DateTime('2050-05-25 12:00:00', new DateTimeZone('Europe/Warsaw'));
echo $date->format(DateTime::ATOM), ' ', $date->format('I U');

Expected result:
2020-05-25T12:00:00+02:00 1 1590400800
2050-05-25T12:00:00+02:00 1 2537089200

Actual result:
2020-05-25T12:00:00+02:00 1 1590400800
2050-05-25T12:00:00+01:00 0 2537089200


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-01-11 08:31 UTC]
-Status: Open +Status: Wont fix
 [2017-01-11 08:31 UTC]
DST information is provided by IANAs timezonedb. That DB is considered accurate only with in half a year. 

No one knows whether a certain area still has DST within the next 10 years, So requesting that information 40 years in advance needs to result in a wrong information. You can NOT relly on that as it is subject to change on short notice. 

Depending on your use-case you should consider a different approach.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sat Jan 28 03:03:45 2023 UTC