Skip to content

date: -u -d "yesterday 10:00 GMT" gives wrong date #10788

@yachi

Description

@yachi

Rust (incorrect):

$ TZ=Australia/Sydney ./target/debug/date -u -d "yesterday 10:00 GMT" "+%F %T %Z"
2026-02-07 10:00:00 UTC

GNU (correct):

$ TZ=Australia/Sydney gdate -u -d "yesterday 10:00 GMT" "+%F %T %Z"
2026-02-06 10:00:00 UTC

Potential root cause: try_parse_with_abbreviation at line 772 calls parse_datetime::parse_datetime(date_part) which may use system time instead of the UTC-adjusted now, unlike the standard path at line 805 which uses parse_datetime_at_date(now, ...).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions