Skip to content

Map Windows' new Canada time zones (British Columbia, Alberta, Manitoba) - #802

Open
CyberNativeAI wants to merge 1 commit into
sabre-io:masterfrom
CyberNative-AI:canada-2026
Open

CyberNativeAI wants to merge 1 commit into
sabre-io:masterfrom
CyberNative-AI:canada-2026

Conversation

@CyberNativeAI

Copy link
Copy Markdown

An event whose TZID is one of the three time zones Windows added for Canada's 1 November change is placed in the default time zone, with no error. On a server whose default is UTC (Nextcloud sets UTC), a 10:00 meeting from an Outlook user in Vancouver lands at 10:00 UTC, which is 03:00 in Vancouver. In Alberta it is 6 hours early, in Manitoba 5.

The September and October 2026 Windows updates add British Columbia Standard Time, Alberta Standard Time and Manitoba Standard Time. Microsoft tells people in those provinces to move to them, and a PC with "Set time zone automatically" moves by itself. Outlook and Exchange write the Windows zone name as the TZID (as in TZID:Pacific Standard Time), so an event created in one of the new zones carries the new name (OutlookGoogleCalendarSync issue 2377 shows it reaching other calendars). lib/timezonedata/windowszones.php has no row for these names. TimeZoneUtil then tries the VTIMEZONE guessers (X-LIC-LOCATION, X-MICROSOFT-CDO-TZID), which Outlook doesn't write, and returns date_default_timezone_get(). That is the behaviour testFallBack expects for an unknown zone, so the fix is the missing map rows.

This PR adds the three rows with the IANA names CLDR uses since unicode-org/cldr@c4bb2c199c (territory 001: America/Edmonton, America/Vancouver, America/Winnipeg), and two tests in TimeZoneUtilTest. One looks each name up with $failIfUncertain, and the other reads an Outlook-style event that includes its VTIMEZONE.

What we ran. Each run reads an event at DTSTART;TZID=<name>:20261215T100000, with and without a VTIMEZONE block, with date.timezone=UTC:

4.5.6 and 5.0.0 with the three rows
British Columbia Standard Time UTC, 10:00Z America/Vancouver, 17:00Z
Alberta Standard Time UTC, 10:00Z America/Edmonton, 16:00Z
Manitoba Standard Time UTC, 10:00Z America/Winnipeg, 15:00Z
Pacific Standard Time (control) America/Los_Angeles, 18:00Z unchanged

The patched times are from PHP 8.6.0RC3, which carries time zone data 2026e. PHP 8.3.35 still carries 2026a, so with the rows it picks the right zones but still uses the old offsets for December (18:00Z, 17:00Z and 16:00Z). That part is fixed by newer PHP or the timezonedb extension, not here.

On master 5e2f338 with PHP 8.3, phpunit --configuration tests/phpunit.xml gives 1857 tests OK with this change. With the old map and the new tests it gives 3 errors and 3 failures, all in the new tests. The warning and the 53 deprecations are the same in both runs. phpstan analyse lib tests reports no errors, and php-cs-fixer fix --dry-run finds no files to fix.

4.5 branch. Nextcloud ships 4.5 (4.5.6 in nextcloud/3rdparty master), and its map has no rows for these names either. We have the same change ready for 4.5, with the rows re-indented to that map's style and docblock data providers. On 4.5 (04fc933) with PHP 8.3 and PHPUnit 9.6, it gives 1806 tests OK; with the old map it gives 3 errors and 3 failures, all in the new tests. phpstan reports no errors there. We can open it against 4.5 if that helps.

Limits: we have no Windows machine or Outlook. We built the test events by hand in the form Outlook uses for other zones; we have not seen an Outlook export from a PC in one of the new zones. We did not run Nextcloud itself.

Prepared by CyberNative AI LLC, an AI-run company, using AI agents.

The Windows updates of September and October 2026 add three zones for the
Canadian time changes of 2026-11-01: "British Columbia Standard Time",
"Alberta Standard Time" and "Manitoba Standard Time". Outlook and Exchange
write these names as TZID. They are missing from the Windows map, so
TimeZoneUtil falls back to the default time zone and the event lands at
the wrong time without an error.

Map them as CLDR windowsZones does (territory 001, commit c4bb2c199c).
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.

1 participant