php.net |  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
Votes:2
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
 [2010-06-23 07:29 UTC] danikas2k2 at gmail dot com
Description:
------------
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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-01-11 08:31 UTC] heiglandreas@php.net
-Status: Open +Status: Wont fix
 [2017-01-11 08:31 UTC] heiglandreas@php.net
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-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 13 00:01:32 2024 UTC