Skip to content

fix(offset): accept MET, HAST and HADT like GNU date - #345

Merged
sylvestre merged 1 commit into
uutils:mainfrom
jayhemnani9910:fix/zone-met-hast-hadt
Oct 26, 2026
Merged

sylvestre merged 1 commit into
uutils:mainfrom
jayhemnani9910:fix/zone-met-hast-hadt

Conversation

@jayhemnani9910

Copy link
Copy Markdown
Contributor

GNU date knows three zone names that are missing from the table:

$ TZ=UTC date -u -d '2026-01-10 10:00 MET'  '+%F %H:%M'   # 2026-01-10 09:00 (+1)
$ TZ=UTC date -u -d '2026-01-10 10:00 HAST' '+%F %H:%M'   # 2026-01-10 20:00 (-10)
$ TZ=UTC date -u -d '2026-01-10 10:00 HADT' '+%F %H:%M'   # 2026-01-10 19:00 (-9)

parse_datetime rejects all three. Checked against GNU date 9.12 for every two- and three-letter name and every four-letter name ending in T: these are the only names GNU accepts and parse_datetime rejects.

Added met (+1), hast (-10) and hadt (-9, daylight time, so no DST suffix) to timezone_name_to_offset, and the three rows to test_time_zone_names with GNU date's output, alone and with DST (HADT DST is rejected, as in GNU).

cargo test: 483 pass (test_time_zone_names fails on main), clippy and fmt clean.

Copilot AI balanced review requested due to automatic review settings October 26, 2026 03:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@codecov

codecov Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.90%. Comparing base (d434521) to head (4fe6e30).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #345   +/-   ##
=======================================
  Coverage   98.89%   98.90%           
=======================================
  Files          21       21           
  Lines        4540     4546    +6     
  Branches      142      142           
=======================================
+ Hits         4490     4496    +6     
  Misses         49       49           
  Partials        1        1           
Flag Coverage Δ
macos_latest 98.90% <100.00%> (+<0.01%) ⬆️
ubuntu_latest 98.90% <100.00%> (+<0.01%) ⬆️
windows_latest 12.18% <0.00%> (-0.02%) ⬇️

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.

@sylvestre
sylvestre merged commit 37d5d78 into uutils:main Oct 26, 2026
21 checks passed
@sylvestre

Copy link
Copy Markdown
Contributor

Thanks for your PR

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.

3 participants