Skip to content

fix(offset): correct ADT, AST, BST and GST to GNU's values - #325

Open
ARMeeru wants to merge 1 commit into
uutils:mainfrom
ARMeeru:fix/gnu-timezone-abbreviation-offsets
Open

fix(offset): correct ADT, AST, BST and GST to GNU's values#325
ARMeeru wants to merge 1 commit into
uutils:mainfrom
ARMeeru:fix/gnu-timezone-abbreviation-offsets

Conversation

@ARMeeru

@ARMeeru ARMeeru commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

timezone_name_to_offset documents its own scope as matching GNU:

GNU date only supports a subset of these. We support the same subset as GNU date.

This is the follow-up to #321, which measured the crate against GNU across 100 candidate abbreviations and found five where both accept the name but the offsets disagree. This PR corrects four of them to their tz database offsets, each a real behaviour fix for current users:

  • ADT -3 (was +4)
  • AST -4 (was -3)
  • BST +1 (was +6)
  • GST +10 (was +4)

For example, parse_datetime("2026-06-15 12:00 BST") currently returns +06:00, which is Bangladesh Standard Time, where GNU says BST is +1 (British Summer Time).

How the offsets were verified

With zdump against the tz databases of macOS 16 and Debian stable; both agree on every value above:

  • ADT -03, AST -04 via America/Halifax
  • BST +01 via Europe/London
  • GST +10 via Pacific/Guam

One finding from the verification itself: GNU date ignores a bare abbreviation token in a date string entirely (verified on 9.7 Linux and 9.11 macOS), so the tz database is the operative reference for what these names mean, and that is what the table was checked against.

The fifth disagreement, SST, is deliberately not touched

The #321 measurements recorded GNU as resolving SST to -12, but the tz database binds SST to -11 (via Pacific/Pago_Pago and Pacific/Midway) and no zone binds it to -12; the same scan on macOS and Debian tzdata agrees. Since the two authorities conflict on this one name, this PR leaves SST at its current -11 and flags the disagreement rather than guessing. Happy to change it if the GNU reading of -12 has a source I could not find.

Tests assert the four corrected values and fail without the fix.

@codecov

codecov Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.34%. Comparing base (618dda7) to head (d71e381).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #325   +/-   ##
=======================================
  Coverage   99.34%   99.34%           
=======================================
  Files          21       21           
  Lines        4123     4131    +8     
  Branches      136      136           
=======================================
+ Hits         4096     4104    +8     
  Misses         26       26           
  Partials        1        1           
Flag Coverage Δ
macos_latest 99.34% <100.00%> (+<0.01%) ⬆️
ubuntu_latest 99.34% <100.00%> (+<0.01%) ⬆️
windows_latest 13.70% <0.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ARMeeru
ARMeeru marked this pull request as ready for review August 31, 2026 06:53
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