coreutils
[Top][All Lists]
Advanced

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

Re: suggested feautre: "date --debug" - print date parsing diagnostics


From: Assaf Gordon
Subject: Re: suggested feautre: "date --debug" - print date parsing diagnostics
Date: Thu, 11 Feb 2016 21:43:27 -0500

Hello,

Attached updated patch with fixes and gettext support.

An example:

    $  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 
12:00pm
    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 
value)
    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

Comments and suggestions are welcome,

regards,
  - assaf


Attachment: coreutils-date-debug.v6.patch
Description: Binary data

Attachment: gnulib-date-debug.v6.patch
Description: Binary data



reply via email to

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