Bug #80963 [Opn]: DateTimeZone::getTransitions() truncated
| From: | thekid@php.net | Date: | Sat, 17 Apr 2021 15:45:26 +0000 |
| Subject: | Bug #80963 [Opn]: DateTimeZone::getTransitions() truncated | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-233474@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=80963&edit=1
ID: 80963
Updated by: thekid@php.net
Reported by: thekid@php.net
Summary: DateTimeZone::getTransitions() truncated
Status: Open
Type: Bug
Package: Date/time related
Operating System: Windows
PHP Version: master-Git-2021-04-17 (Git)
-Assigned To:
+Assigned To: derick
Block user comment: N
Private report: N
New Comment:
For Europe/Berlin and Europe/London, the array returned "stops" at 1996
For America/New_York, the latest transition returned is from 2007
# PHP 8.1-dev
$ php -r '$tz= new DateTimeZone("America/New_York"); $t= $tz->getTransitions();
var_dump($t);' | grep 'string(24)' | sort -r | head -5
string(24) "2007-03-11T07:00:00+0000"
string(24) "2006-10-29T06:00:00+0000"
string(24) "2006-04-02T07:00:00+0000"
string(24) "2005-10-30T06:00:00+0000"
string(24) "2005-04-03T07:00:00+0000"
# PHP 8.0.3
$ php -r '$tz= new DateTimeZone("America/New_York"); $t= $tz->getTransitions();
var_dump($t);' | grep 'string(24)' | sort -r | head -5
string(24) "2037-11-01T06:00:00+0000"
string(24) "2037-03-08T07:00:00+0000"
string(24) "2036-11-02T06:00:00+0000"
string(24) "2036-03-09T07:00:00+0000"
string(24) "2035-11-04T06:00:00+0000"
Previous Comments:
------------------------------------------------------------------------
[2021-04-17 15:16:40] thekid@php.net
Description:
------------
DateTimeZone::getTransitions() changed between PHP 8.0.3 and current PHP 8.1.0-dev. Most probably
related to https://github.com/php/php-src/commit/091c0920b9db057a54dc43ece6e864bce6818d5e
Test script:
---------------
php -r '$tz= new DateTimeZone("Europe/London"); $t= $tz->getTransitions();
var_dump(sizeof($t), end($t));'
Expected result:
----------------
int(243)
array(5) {
["ts"]=>
int(2140045200)
["time"]=>
string(24) "2037-10-25T01:00:00+0000"
["offset"]=>
int(0)
["isdst"]=>
bool(false)
["abbr"]=>
string(3) "GMT"
}
Actual result:
--------------
int(160)
array(5) {
["ts"]=>
int(828234000)
["time"]=>
string(24) "1996-03-31T01:00:00+0000"
["offset"]=>
int(3600)
["isdst"]=>
bool(true)
["abbr"]=>
string(3) "BST"
}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=80963&edit=1