Repository navigation
Map Windows' new Canada time zones (British Columbia, Alberta, Manitoba) - #802
Open
CyberNativeAI wants to merge 1 commit into
Open
CyberNativeAI wants to merge 1 commit into
CyberNativeAI wants to merge 1 commit into
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An event whose
TZIDis 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 TimeandManitoba 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 theTZID(as inTZID: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.phphas no row for these names.TimeZoneUtilthen tries the VTIMEZONE guessers (X-LIC-LOCATION,X-MICROSOFT-CDO-TZID), which Outlook doesn't write, and returnsdate_default_timezone_get(). That is the behaviourtestFallBackexpects 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 inTimeZoneUtilTest. 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, withdate.timezone=UTC:British Columbia Standard TimeAmerica/Vancouver, 17:00ZAlberta Standard TimeAmerica/Edmonton, 16:00ZManitoba Standard TimeAmerica/Winnipeg, 15:00ZPacific Standard Time(control)America/Los_Angeles, 18:00ZThe 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
timezonedbextension, not here.On master
5e2f338with PHP 8.3,phpunit --configuration tests/phpunit.xmlgives 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 testsreports no errors, andphp-cs-fixer fix --dry-runfinds no files to fix.4.5 branch. Nextcloud ships 4.5 (4.5.6 in
nextcloud/3rdpartymaster), and its map has no rows for these names either. We have the same change ready for4.5, with the rows re-indented to that map's style and docblock data providers. On4.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.phpstanreports no errors there. We can open it against4.5if 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.