Problem/Motivation

See https://www.drupal.org/pift-ci-job/1160752

It appears recent commits to PHP 7.3 branch have changed how old timezones are worked out. The suspect commits are Merge branch 'timelib-201801RC3' into PHP-7.3 see https://github.com/php/php-src/commits/PHP-7.3?after=1b86f84908b4fd495e7...

The problem is on the latest PHP 7.3 build you get different results for

$date = new DateTime('1809-02-12 10:30', new DateTimeZone('America/Chicago'));
var_dump($date->format('c'));

This outputs 1809-02-12T10:30:00-06:00 on PHP7.3.0 and earlier but on HEAD it outputs 1809-02-12T10:30:00-05:50

It appears that Chicago changed it's timezone offset on 19th Nov 1883...

php -r " var_dump((new DateTime('1883-11-18 10:30', new DateTimeZone('America/Chicago')))->format('c'));"
string(25) "1883-11-18T10:30:00-05:50"
php -r " var_dump((new DateTime('1883-11-19 10:30', new DateTimeZone('America/Chicago')))->format('c'));"
string(25) "1883-11-19T10:30:00-06:00"

Apparently some peeps had a meeting in a hotel in October and standardised everything - https://www.chicagomag.com/city-life/January-2018/How-Chicago-Gave-Ameri...

Proposed resolution

Change the date used in the test to be 19th November 1883.

Remaining tasks

User interface changes

N/a

API changes

N/a

Data model changes

N/a

Release notes snippet

N/a

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alexpott created an issue. See original summary.

Wim Leers’s picture

Status: Needs review » Reviewed & tested by the community

WOW! #historyLessonsPoweredByPhpAndDrupal

vijaycs85’s picture

+1 @alexpott++

catch’s picture

Status: Reviewed & tested by the community » Fixed

Wow.

Committed and pushed 6a888784fc to 8.7.x and 567ec6353d to 8.6.x. Thanks!

  • catch committed db41beb on 8.7.x
    Issue #3023402 by alexpott: \Drupal\Tests\Component\Datetime\...

  • catch committed 567ec63 on 8.6.x
    Issue #3023402 by alexpott: \Drupal\Tests\Component\Datetime\...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.