Skip to content

Commit b9374b4

Browse files
committed
gh-159715: Cite the specification for transition hour limits
1 parent 1bcb2eb commit b9374b4

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎Lib/zoneinfo/_zoneinfo.py‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,8 +477,11 @@ def _get_trans_info(self, ts, year, fold):
477477
"""Get the information about the current transition - tti"""
478478

479479
year_start = (_post_epoch_days_before_year(year) + 1) * _SECONDS_PER_DAY
480-
# _parse_transition_time caps the hour field at 167; _parse_tz_delta
481-
# caps it at 24, with one extra hour possible for default DST.
480+
# RFC 9636, section 3.3.2 specifies transition hours from -167 to 167
481+
# for TZif v3+; _parse_transition_time enforces this limit.
482+
# https://www.rfc-editor.org/rfc/rfc9636.html#section-3.3.2
483+
# _parse_tz_delta caps offset hours at 24 (the POSIX TZ limit),
484+
# with one extra hour possible for default DST.
482485
# Including minute/second fields and the offset difference across a
483486
# fold, the displacement is less than 11 days. Use a common year's
484487
# length here, leaving an extra day of margin in leap years.

0 commit comments

Comments
 (0)