[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fwd: suggested feature: "date --debug" - print date parsing diagnostics

From: Pádraig Brady
Subject: Fwd: suggested feature: "date --debug" - print date parsing diagnostics
Date: Tue, 9 Aug 2016 11:52:39 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

FYI attached is a proposed patch from Assaf Gordon.
I'm about to apply this to the parse-datetime module to support diagnostic 
output to help users.
This will be enabled soon from the coreutils date(1) util like:

    $  TZ=America/Belize src/date --debug \
                  -d 'TZ="Asia/Tokyo" Sun, 90-12-11 + 3 days - 90 minutes'
    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: +09:00 (set from 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 TZ=+09:00'
    date: warning: when adding relative days, it is recommended to specify 
    date: after date adjustment (+0 years, +0 months, +3 days),
    date:     new date/time = '(Y-M-D) 1990-12-14 00:00:00 TZ=+09:00'
    date: '(Y-M-D) 1990-12-14 00:00:00 TZ=+09:00' = 661100400 epoch-seconds
    date: after time adjustment (+0 hours, -90 minutes, +0 seconds, +0 ns),
    date:     new time = 661095000 epoch-seconds
    date: output timezone: -06:00 (set from TZ="America/Belize" environment 
    date: final: 661095000.000000000 (epoch-seconds)
    date: final: (Y-M-D) 1990-12-13 13:30:00 (UTC0)
    date: final: (Y-M-D) 1990-12-13 07:30:00 (output timezone TZ=-06:00)
    Thu Dec 13 07:30:00 CST 1990

We have _many_ questions on date/time parsing issues,
so this should detail the operation to users
and thus any required adjustments.

Attachment: gnulib--0001-parse-datetime-add-optional-debug-printing.patch.xz
Description: Binary data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]