fix(timezone): half-hour DST shift for Australia/Lord_Howe - #464
Merged
spencermountain merged 1 commit intoJul 2, 2026
Merged
Conversation
Lord Howe observes a 30-minute DST shift (standard +10:30, DST +11:00), but the offset derivation hardcoded a 1-hour shift for every zone. During southern summer this returned +11:30 instead of +11:00, so offset(), formatting, and UTC-to-wall-clock were 30 minutes ahead for the DST half of the year. Derive the shift per zone, special-casing the only IANA half-hour DST zone.
Owner
|
thank you!! |
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.
Australia/Lord_Howe uses a 30-minute DST shift, but spacetime reports it as a full hour, so every instant in the DST half of the year is 30 minutes off.
Repro
ACTUAL:
+11:30(690 min). EXPECTED:+11:00(660 min).Root cause
In
src/timezone/index.js, the "other-season" offset is derived by hardcoding a 1-hour DST shift (winter = summer - 1north,found.offset + 1south). Lord Howe is the only IANA zone with a 30-minute DST shift (standard +10:30, DST +11:00). Its zonefile stores the standard offset10.5; adding a full hour yields +11:30 instead of +11:00 for the summer (DST) side. This affectsoffset(), formatting, and UTC-to-wall-clock conversion for the whole DST half of the year.The July / standard side was already correct (+10:30), because it reads the stored offset directly.
Fix
Derive the shift per zone and special-case the single half-hour zone:
Then use
dstShiftin place of the hardcoded1for both hemispheres.Tests
Added a case to
test/dst-south.test.jsthat assertsoffset()against the nativeIntllongOffsetoracle for both seasons: January+11:00and July+10:30.Red baseline: with the source change reverted, the January assertion fails (690 vs 660); July already passes. With the fix, both pass.
Full suite (tape): 6080 tests. Before the fix 12 failed (11 pre-existing America/Denver minute-boundary cases in
test/dst-sneak.test.js, plus the new Lord Howe case). After the fix 11 fail, all of them the same pre-existing Denver cases, which this change does not touch.