Bug #67675 [Asn->Opn]: DateTimeZone->getTransitions()->ts returns invalid value

From: Date: Tue, 24 Oct 2017 08:13:21 +0000
Subject: Bug #67675 [Asn->Opn]: DateTimeZone->getTransitions()->ts returns invalid value
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-212243@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=67675&edit=1

 ID:                 67675
 Updated by:         kalle@php.net
 Reported by:        greenrover33 at gmail dot com
 Summary:            DateTimeZone->getTransitions()->ts returns invalid
                     value
-Status:             Assigned
+Status:             Open
 Type:               Bug
 Package:            Date/time related
 Operating System:   Linux
 PHP Version:        5.6Git-2014-07-29 (Git)
-Assigned To:        derick
+Assigned To:        
 Block user comment: N
 Private report:     N



Previous Comments:
------------------------------------------------------------------------
[2014-07-29 14:29:49] derick@php.net

You're right that it shouldn't be MIN_LONG, but the first entries should be:

Europe/Berlin  Fri Mar 31 23:06:31 1893 UT = Fri Mar 31 23:59:59 1893 LMT isdst=0 gmtoff=3208
Europe/Berlin  Fri Mar 31 23:06:32 1893 UT = Sat Apr  1 00:06:32 1893 CET isdst=0 gmtoff=3600
Europe/Berlin  Sun Apr 30 21:59:59 1916 UT = Sun Apr 30 22:59:59 1916 CET isdst=0 gmtoff=3600
Europe/Berlin  Sun Apr 30 22:00:00 1916 UT = Mon May  1 00:00:00 1916 CEST isdst=1 gmtoff=7200
Europe/Berlin  Sat Sep 30 22:59:59 1916 UT = Sun Oct  1 00:59:59 1916 CEST isdst=1 gmtoff=7200
Europe/Berlin  Sat Sep 30 23:00:00 1916 UT = Sun Oct  1 00:00:00 1916 CET isdst=0 gmtoff=3600

------------------------------------------------------------------------
[2014-07-29 11:36:22] greenrover33 at gmail dot com

Tested it with:  5.6Git-2014-07-29 (Git)

------------------------------------------------------------------------
[2014-07-24 12:10:51] greenrover33 at gmail dot com

Description:
------------
This ts is empty. Because its a to high/low number.
[ts] => -9223372036854775808 === empty($ts->ts)
[ts] => -9223372036854775808 === !isset($ts->ts)

Test script:
---------------
<?PHP
$tz = new DateTimeZone('Europe/Berlin');

foreach ($tz->getTransitions() as $ts) {
    if (empty($ts->ts)) {
        echo "HRERE is the bug\n";
        print_r($ts);  

        echo "\n\nfull log:\n";
        print_r($tz->getTransitions());
        die();
    }
}

echo "The bug was fixed";
die();


Expected result:
----------------
First row is:
Array
(
    [ts] => -9223372036854775808
    [time] => -292277022657-01-27T08:29:52+0000
    [offset] => 7200
    [isdst] => 1
    [abbr] => CEST
)

Actual result:
--------------
First row should be:

Array
(
    [ts] => -1693706400
    [time] => 1916-04-30T22:00:00+0000
    [offset] => 7200
    [isdst] => 1
    [abbr] => CEST
)



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=67675&edit=1


Thread (6 messages)

« previous php.bugs (#212243) next »