Skip to content

date: --debug option not yet implemented #7342

Open

Description

@jfinkels

The date --debug option is not yet implemented. Here's an example of the output:

 TZ=America/Belize date --debug -d 'TZ="Asia/Tokyo" Sun, 90-12-11 + 3 days - 90 minutes' +'%a %b %e %T %z %Y'
date: parsed day part: Sun (day ordinal=0 number=0)
date: parsed date part: (Y-M-D) 0090-12-11
date: parsed relative part: +3 day(s)
date: parsed relative part: +3 day(s) -90 minutes
date: input timezone: TZ="Asia/Tokyo" in date string
date: warning: adjusting year value 90 to 1990
date: warning: using midnight as starting time: 00:00:00
date: warning: day (Sun) ignored when explicit dates are given
date: starting date/time: '(Y-M-D) 1990-12-11 00:00:00'
date: warning: when adding relative days, it is recommended to specify noon
date: after date adjustment (+0 years, +0 months, +3 days),
date:     new date/time = '(Y-M-D) 1990-12-14 00:00:00'
date: '(Y-M-D) 1990-12-14 00:00:00' = 661100400 epoch-seconds
date: after time adjustment (+0 hours, -90 minutes, +0 seconds, +0 ns),
date:     new time = 661095000 epoch-seconds
date: timezone: TZ="Asia/Tokyo" environment value
date: final: 661095000.000000000 (epoch-seconds)
date: final: (Y-M-D) 1990-12-13 13:30:00 (UTC)
date: final: (Y-M-D) 1990-12-13 22:30:00 (UTC+09)
date: output format: ‘%a %b %e %T %z %Y’
Thu Dec 13 07:30:00 -0600 1990

Most of these messages would need to be implemented in the parse_datetime library, where the parsing happens.

Activity

  1. ChrisDryden commented on Feb 15, 2026

    @ChrisDryden
    Collaborator

    The debug flag was just added in #10940 some of the debug messages were added but there is still a bunch more to add

  2. HackingRepo commented on Jun 29, 2026

    @HackingRepo
    Contributor

    @sylvestre --debug have been implemented, close that

  3. sylvestre commented on Jun 29, 2026

    @sylvestre
    SponsorContributor

    we have the flag but we didn't implemented everything. the gnu test doesn't pass

  4. xtqqczze commented on Oct 13, 2026

    @xtqqczze
    Collaborator

    Current output as of 1747ba1:

    $ TZ=America/Belize cargo run -q date --debug -d 'TZ="Asia/Tokyo" Sun, 90-12-11 + 3 days - 90 minutes' +'%a %b %e %T %z %Y'
    date: input string: TZ="Asia/Tokyo" Sun, 90-12-11 + 3 days - 90 minutes
    date: parsed date part: (Y-M-D) 1990-12-13
    date: parsed time part: 07:30:00
    date: input timezone: system default
    Thu Dec 13 07:30:00 -0600 1990
  5. anastygnome commented on Oct 21, 2026

    @anastygnome
    Contributor

    It's parsing dependent, which is in the end language dependent, we should try to adapt it but imho we'll have to patch it. No one should rely on debug output but decs anyway

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions