Bug #76530 [NEW]: Timezone is incorrectly applied when converting dates beyond 2037

From: Date: Tue, 26 Jun 2018 03:52:15 +0000
Subject: Bug #76530 [NEW]: Timezone is incorrectly applied when converting dates beyond 2037
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-215974@lists.php.net to get a copy of this message
From: mlambley at gmail dot com Operating system: Windows 10, FreeBSD, others PHP version: 7.2.7 Package: Scripting Engine problem Bug Type: Bug Bug description:Timezone is incorrectly applied when converting dates beyond 2037 Description: ------------ Right now, it is not daylight savings in Adelaide, Australia. Converting a \DateTime object with 2037-10-04 or earlier into ISO 8601 (format 'c') correctly makes the time zone +09:30 However, any date beyond this will incorrectly add the daylight savings to the time zone +10:30 Please note that this issue may be time sensitive. If you're executing the code during the Australian summer you may not be able to reproduce the results. Confirmed not working on a freshly downloaded, unmodified version of PHP v7.2.7 Test script: --------------- <?php date_default_timezone_set('Australia/Adelaide'); $date1 = new DateTime('2037-10-05'); var_dump($date1->format('c')); $date2 = new DateTime('2037-10-04'); var_dump($date2->format('c')); Expected result: ---------------- string(25) "2037-10-05T00:00:00+09:30" string(25) "2037-10-04T00:00:00+09:30" Actual result: -------------- string(25) "2037-10-05T00:00:00+10:30" string(25) "2037-10-04T00:00:00+09:30" -- Edit bug report at https://bugs.php.net/bug.php?id=76530&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=76530&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=76530&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=76530&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=76530&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=76530&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=76530&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=76530&r=needscript Try newer version: https://bugs.php.net/fix.php?id=76530&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=76530&r=support Expected behavior: https://bugs.php.net/fix.php?id=76530&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=76530&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=76530&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=76530&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76530&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=76530&r=dst IIS Stability: https://bugs.php.net/fix.php?id=76530&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=76530&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=76530&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=76530&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=76530&r=mysqlcfg

« previous php.bugs (#215974) next »