Skip to content

Map new Microsoft time zones for Alberta, Manitoba and British Columbia - #120

Merged
valentinbonneaud merged 1 commit into
masterfrom
feat/canada-2026-microsoft-timezones
Nov 5, 2026
Merged

valentinbonneaud merged 1 commit into
masterfrom
feat/canada-2026-microsoft-timezones

Conversation

@valentinbonneaud

@valentinbonneaud valentinbonneaud commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

Alberta, Manitoba and British Columbia moved to permanent time on 2026-11-01. Outlook/Exchange now sends invites and calendar exports with new Microsoft time zone names that TimeZoneUtil can't resolve:

  • TimeZoneUtil::getTimeZone($tzid, $vcalendar, failIfUncertain: true) throws We were unable to determine the correct PHP timezone for tzid: Alberta Standard Time, so callers that parse DTSTART drop the event.
  • Without $failIfUncertain, it silently falls back to the PHP default time zone, so the event lands at the wrong time.

Change

Adds to lib/timezonedata/extrazones.php:

Microsoft name IANA zone
Alberta Standard Time America/Edmonton
Mountain Time (Alberta) America/Edmonton
Manitoba Standard Time America/Winnipeg
Pacific Time (British Columbia) America/Vancouver
British Columbia Standard Time America/Vancouver

The other forms Outlook produces already resolve once the base name is mapped:

  • Alberta Standard Time 1 (numbered variants in Outlook exports), through FindFromMzVersionTimezone
  • (UTC-06:00) Mountain Time (Alberta) (offset-prefixed display names), through the existing patterns in FindFromTimezoneMap

Tests

  • TimeZoneUtilTest::testCanadaPermanentTimeZones covers 9 forms: each name, the numbered … 1 variants and the (UTC±hh:mm) … prefixed variants. All 9 fail without the new entries.
  • vendor/bin/phpunit -c tests/phpunit.xml (3,301 tests), phpstan analyse lib tests and php-cs-fixer fix --dry-run are green.

@valentinbonneaud
valentinbonneaud merged commit 4e8d8fb into master Nov 5, 2026
4 checks passed
This was referenced Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants