Bug->Doc #75790 [Opn]: DateTimeZone::getTransitions(start,end)->ts is incorrect

From: Date: Wed, 10 Jan 2018 10:14:12 +0000
Subject: Bug->Doc #75790 [Opn]: DateTimeZone::getTransitions(start,end)->ts is incorrect
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-15322@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75790&edit=1 ID: 75790 Updated by: derick@php.net Reported by: z dot dacto at gmail dot com Summary: DateTimeZone::getTransitions(start,end)->ts is incorrect Status: Open -Type: Bug +Type: Documentation Problem Package: Date/time related Operating System: Linux debian 3.16.0-4-amd64 PHP Version: 5.6.33 Block user comment: N Private report: N New Comment: This is by design, but it does not seem documented. Marking it as a "Documentation Problem". Previous Comments: ------------------------------------------------------------------------ [2018-01-10 08:15:34] z dot dacto at gmail dot com 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 this bug report at https://bugs.php.net/bug.php?id=75790&edit=1

« previous php.doc.bugs (#15322) next »