[wp-trac] [WordPress Trac] #53780: PHP 8.1: DateTimeZone::getTransitions() change

WordPress Trac noreply at wordpress.org
Thu Jun 30 22:51:37 UTC 2022


#53780: PHP 8.1: DateTimeZone::getTransitions() change
--------------------------+-----------------------
 Reporter:  autotutorial  |       Owner:  (none)
     Type:  defect (bug)  |      Status:  reopened
 Priority:  normal        |   Milestone:
Component:  Date/Time     |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  php81 close   |     Focuses:
--------------------------+-----------------------
Changes (by autotutorial):

 * status:  closed => reopened
 * resolution:  reported-upstream =>


Comment:

 {{{#!php
 <?php
 $tz = new DateTimeZone('America/Chicago');
 $start = 1320562800;
 $end = 1357020000;
 $transitions = $tz->getTransitions($start, $end);
 var_dump($transitions);
 array(4) {
   [0]=>
   array(5) {
     ["ts"]=>
     int(1320562800)
     ["time"]=>
     string(24) "2011-11-06T07:00:00+0000"
     ["offset"]=>
     int(-21600)
     ["isdst"]=>
     bool(false)
     ["abbr"]=>
     string(3) "CST"
   }
   [1]=>
   array(5) {
     ["ts"]=>
     int(1320562800)
     ["time"]=>
     string(24) "2011-11-06T07:00:00+0000"
     ["offset"]=>
     int(-21600)
     ["isdst"]=>
     bool(false)
     ["abbr"]=>
     string(3) "CST"
   }
   [2]=>
   array(5) {
     ["ts"]=>
     int(1331452800)
     ["time"]=>
     string(24) "2012-03-11T08:00:00+0000"
     ["offset"]=>
     int(-18000)
     ["isdst"]=>
     bool(true)
     ["abbr"]=>
     string(3) "CDT"
   }
   [3]=>
   array(5) {
     ["ts"]=>
     int(1352012400)
     ["time"]=>
     string(24) "2012-11-04T07:00:00+0000"
     ["offset"]=>
     int(-21600)
     ["isdst"]=>
     bool(false)
     ["abbr"]=>
     string(3) "CST"
   }
 }

 PHP 8.1.0 - 8.1.5
 array(1) {
   [0]=>
   array(5) {
     ["ts"]=>
     int(1320562800)
     ["time"]=>
     string(24) "2011-11-06T07:00:00+0000"
     ["offset"]=>
     int(-18000)
     ["isdst"]=>
     bool(true)
     ["abbr"]=>
     string(3) "CDT"
   }
 }
 /*

 */
 }}}

 https://github.com/WordPress/WordPress/blob/master/wp-admin/options-
 general.php#L284

 $transitions[1] ? :)

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/53780#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list