Bug #75790 [NEW]: DateTimeZone::getTransitions(start,end)->ts is incorrect
| From: | z dot dacto at gmail dot com | Date: | Wed, 10 Jan 2018 08:15:38 +0000 |
| Subject: | Bug #75790 [NEW]: DateTimeZone::getTransitions(start,end)->ts is incorrect | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-213455@lists.php.net to get a copy of this message | ||
From: z dot dacto at gmail dot com
Operating system: Linux debian 3.16.0-4-amd64
PHP version: 5.6.33
Package: Date/time related
Bug Type: Bug
Bug description:DateTimeZone::getTransitions(start,end)->ts is incorrect
Description:
------------
When optional argument
$timestamp_begin is provided to
DateTimeZone::getTransitions the first transition returned assumes a
ts value of $timestamp_begin and a time value formatted from
$timestamp_begin.
The first transition should instead be the one active during
$timestamp_begin.
Test script:
---------------
<!DOCTYPE html>
<html>
<body>
<pre>
<?php
$tz = new DateTimeZone('America/Los_Angeles');
# 1509872300 = 11-05-2017T8:58:20+0000
# 1515570270 = 01-10-2018T7:44:30+0000
$transition = $tz->getTransitions(1509872300, 1515570270);
print_r($transition);
?>
</pre>
</body>
</html>
Expected result:
----------------
Array
(
[0] => Array
(
[ts] => 1489312800
[time] => 2017-03-12T10:00:00+0000
[offset] => -25200
[isdst] => 1
[abbr] => PDT
)
[1] => Array
(
[ts] => 1509872400
[time] => 2017-11-05T09:00:00+0000
[offset] => -28800
[isdst] =>
[abbr] => PST
)
)
Actual result:
--------------
Array
(
[0] => Array
(
[ts] => 1509872300
[time] => 2017-11-05T08:58:20+0000
[offset] => -25200
[isdst] => 1
[abbr] => PDT
)
[1] => Array
(
[ts] => 1509872400
[time] => 2017-11-05T09:00:00+0000
[offset] => -28800
[isdst] =>
[abbr] => PST
)
)
--
Edit bug report at https://bugs.php.net/bug.php?id=75790&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=75790&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=75790&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=75790&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=75790&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=75790&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=75790&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=75790&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=75790&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=75790&r=support
Expected behavior: https://bugs.php.net/fix.php?id=75790&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=75790&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=75790&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=75790&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75790&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=75790&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=75790&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=75790&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=75790&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=75790&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=75790&r=mysqlcfg