Skip to content

Timezone Europe/Berlin does not have DST transitions #268

Closed

Description

@thekid

With a current PHP 8.1 build, we see these when running the date & time test suite.

PHP 8.0, expected result

$ xp -w 'use util\{Date, TimeZone}; $tz= new TimeZone("Europe/Berlin"); return $tz->previousTransition(Date::now())'
util.TimeZoneTransition@{
  transition at: 2021-03-28 03:00:00+0200
  transition to: 7200 (CEST), DST
}

PHP 8.1-dev, incorrect

$ xp -w 'use util\{Date, TimeZone}; $tz= new TimeZone("Europe/Berlin"); return $tz->previousTransition(Date::now())'
Uncaught exception: Exception lang.IllegalArgumentException (Timezone Europe/Berlin does not have DST transitions.)
# ...

$ xp -e 'phpinfo()' | head -8
phpinfo()
PHP Version => 8.1.0-dev

System => Windows NT SURFACE 10.0 build 19042 (Windows 10) AMD64
Build Date => Apr 16 2021 23:42:47
Build System => Microsoft Windows Server 2019 Datacenter [10.0.17763]
Compiler => Visual C++ 2019
Architecture => x64

Activity

  1. thekid commented on Apr 17, 2021

    @thekid
    MemberAuthor

    Most probably related to php/php-src@091c092, which is a huge diff (52,924 additions and 29,617 deletions).

    I've opened a PHP bug: https://bugs.php.net/bug.php?id=80963

  2. thekid commented on Apr 18, 2021

    @thekid
    MemberAuthor

    Quoting from the bug:

    This is a tricky one. The data format that the library uses has changed, and will now only contain a list of transitions up until the last time the rules changed.

    For America/New_York, that was in 2007, and Europe/London, in 1996

  3. thekid commented on Apr 25, 2021

    @thekid
    MemberAuthor

    The tests in question have been disabled for the time being by only running them with PHP up until 8.1.0-dev:

    $ grep -Hirn -A 1 8.1.0-dev src/test/php/ | cut -d / -f 6-
    unittest/util/CalendarTest.class.php:89:  #[Test, Action(eval: 'new RuntimeVersion("<8.1.0-dev")')]
    unittest/util/CalendarTest.class.php-90-  public function testCalendarDSTBegin() {
    --
    unittest/util/CalendarTest.class.php:100:  #[Test, Action(eval: 'new RuntimeVersion("<8.1.0-dev")')]
    unittest/util/CalendarTest.class.php-101-  public function testCalendarDSTBeginByDate() {
    --
    unittest/util/CalendarTest.class.php:111:  #[Test, Action(eval: 'new RuntimeVersion("<8.1.0-dev")')]
    unittest/util/CalendarTest.class.php-112-  public function testCalendarDSTBeginUS() {
    --
    unittest/util/CalendarTest.class.php:121:  #[Test, Action(eval: 'new RuntimeVersion("<8.1.0-dev")')]
    unittest/util/CalendarTest.class.php-122-  public function testCalendarDSTEnd() {
    --
    unittest/util/TimeZoneTest.class.php:43:  #[Test, Action(eval: 'new RuntimeVersion("<8.1.0-dev")')]
    unittest/util/TimeZoneTest.class.php-44-  public function previousTransition() {
    --
    unittest/util/TimeZoneTest.class.php:52:  #[Test, Action(eval: 'new RuntimeVersion("<8.1.0-dev")')]
    unittest/util/TimeZoneTest.class.php-53-  public function previousPreviousTransition() {
    --
    unittest/util/TimeZoneTest.class.php:62:  #[Test, Action(eval: 'new RuntimeVersion("<8.1.0-dev")')]
    unittest/util/TimeZoneTest.class.php-63-  public function previousNextTransition() {
    --
    unittest/util/TimeZoneTest.class.php:72:  #[Test, Action(eval: 'new RuntimeVersion("<8.1.0-dev")')]
    unittest/util/TimeZoneTest.class.php-73-  public function nextTransition() {
  4. thekid commented on Aug 21, 2021

    @thekid
    MemberAuthor

    https://bugs.php.net/bug.php?id=80963 was closed on August 8th, retesting with current PHP verifies this once again works as expected.

  5. added a commit that references this issue on Aug 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions