Skip to content

Commit c92e92a

Browse files
committed
Give Alberta and Manitoba their own timezones
Alberta and Manitoba stop changing their clocks in November 2026, like British Columbia, so "Mountain Time (US & Canada)" and "Central Time (US & Canada)" no longer describe them. Both provinces get their own entry. `Canada/Central` follows Manitoba's rules, so it can no longer stand in for US Central time or for Central America, which stays on UTC-6. "Central America" moves to `America/Guatemala`, and US Central time is left to `US/Central` alone.
1 parent ce25244 commit c92e92a

3 files changed

Lines changed: 74 additions & 2 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
## [Unreleased]
88
### Added
99
- Add `America/Vancouver`, since British Columbia stays on UTC-7 all year from November 2026.
10+
- Add `America/Edmonton` and `America/Winnipeg`, since Alberta and Manitoba stay on UTC-6 and UTC-5 all year from November 2026.
11+
12+
### Changed
13+
- "Central America" uses `America/Guatemala` instead of `Canada/Central`, which follows Manitoba's rules.
14+
15+
### Removed
16+
- Drop the `Canada/Central` entry labeled "Central Time (US & Canada)". `US/Central` covers the US, and `America/Winnipeg` covers Manitoba.
1017

1118
## [3.0.0] - 2024-11-15
1219
### Changed

‎timezones/_defs.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,15 @@
3535
# -06
3636
("America/Chihuahua", "Chihuahua"),
3737
("US/Central", "Central Time (US & Canada)"),
38-
("Canada/Central", "Central America"),
39-
("Canada/Central", "Central Time (US & Canada)"),
38+
("America/Guatemala", "Central America"),
39+
("America/Edmonton", "Edmonton"),
4040
("Mexico/General", "Guadalajara"),
4141
("Mexico/General", "Mexico City"),
4242
("America/Monterrey", "Monterrey"),
4343
("Canada/Saskatchewan", "Saskatchewan"),
4444
# -05
4545
("America/Bogota", "Bogota"),
46+
("America/Winnipeg", "Winnipeg"),
4647
("US/Eastern", "Eastern Time (US & Canada)"),
4748
("US/East-Indiana", "Indiana (East)"),
4849
("America/Lima", "Lima"),

‎timezones/test_timezones.py‎

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
from datetime import datetime, timedelta
2+
from zoneinfo import ZoneInfo
3+
14
import pytest
25

36
from . import _defs, tz_rendering, tz_utils, zones
@@ -89,3 +92,64 @@ def test_get_timezones_lists_vancouver():
8992
vancouver_labels.append(verbose_name)
9093
assert len(vancouver_labels) == 1
9194
assert vancouver_labels[0].endswith(") Vancouver")
95+
96+
97+
def test_get_timezones_lists_edmonton():
98+
# Given Alberta has its own timezone from November 2026
99+
edmonton_labels = []
100+
101+
# When the supported timezones are listed
102+
all_timezones = zones.get_timezones()
103+
104+
# Then America/Edmonton is offered under its own name
105+
for offset_str, tzname, verbose_name in all_timezones:
106+
if tzname == "America/Edmonton":
107+
edmonton_labels.append(verbose_name)
108+
assert len(edmonton_labels) == 1
109+
assert edmonton_labels[0].endswith(") Edmonton")
110+
111+
112+
def test_get_timezones_lists_winnipeg():
113+
# Given Manitoba has its own timezone from November 2026
114+
winnipeg_labels = []
115+
116+
# When the supported timezones are listed
117+
all_timezones = zones.get_timezones()
118+
119+
# Then America/Winnipeg is offered under its own name
120+
for offset_str, tzname, verbose_name in all_timezones:
121+
if tzname == "America/Winnipeg":
122+
winnipeg_labels.append(verbose_name)
123+
assert len(winnipeg_labels) == 1
124+
assert winnipeg_labels[0].endswith(") Winnipeg")
125+
126+
127+
def test_get_timezones_offers_us_central_time_only_for_us_central():
128+
# Given Manitoba no longer follows US Central time from November 2026
129+
central_time_zone_names = []
130+
131+
# When the supported timezones are listed
132+
all_timezones = zones.get_timezones()
133+
134+
# Then "Central Time (US & Canada)" is offered only for US/Central
135+
for offset_str, tzname, verbose_name in all_timezones:
136+
if verbose_name.endswith(") Central Time (US & Canada)"):
137+
central_time_zone_names.append(tzname)
138+
assert central_time_zone_names == ["US/Central"]
139+
140+
141+
def test_get_timezones_keeps_central_america_on_utc_minus_6():
142+
# Given a date in December 2026, after Manitoba stops changing its clocks
143+
december_2026 = datetime(2026, 12, 1, 12, 0)
144+
central_america_zone_names = []
145+
146+
# When the supported timezones are listed
147+
all_timezones = zones.get_timezones()
148+
149+
# Then "Central America" is offered once, on a zone that is at UTC-6 then
150+
for offset_str, tzname, verbose_name in all_timezones:
151+
if verbose_name.endswith(") Central America"):
152+
central_america_zone_names.append(tzname)
153+
assert len(central_america_zone_names) == 1
154+
central_america_zone = ZoneInfo(central_america_zone_names[0])
155+
assert central_america_zone.utcoffset(december_2026) == timedelta(hours=-6)

0 commit comments

Comments
 (0)