-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
Description
EDT means UTC-4 always, but Rust uses UTC-5 when the date falls in winter:
$ TZ=UTC ./target/debug/date -u -d "2026-01-15 10:00 EDT" "+%F %T %Z"
2026-01-15 15:00:00 UTC
$ TZ=UTC gdate -u -d "2026-01-15 10:00 EDT" "+%F %T %Z"
2026-01-15 14:00:00 UTC
Same with PST in summer (gives UTC-7 instead of UTC-8):
$ TZ=UTC ./target/debug/date -u -d "2026-06-15 10:00 PST" "+%F %T %Z"
2026-06-15 17:00:00 UTC
$ TZ=UTC gdate -u -d "2026-06-15 10:00 PST" "+%F %T %Z"
2026-06-15 18:00:00 UTC
Affects EDT/PDT/CDT/MDT.
Potential root cause: try_parse_with_abbreviation maps EDT → America/New_York, then dt.to_zoned(tz) uses the zone's current offset for that date (EST/UTC-5 in winter) instead of the fixed offset EDT implies (UTC-4).
Reactions are currently unavailable