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: Leslie S Satenstein
Subject: Re: suggested feautre: "date --debug" - print date parsing diagnostics
Date: Sat, 13 Feb 2016 12:27:44 +0000 (UTC)

I like your debug option. Your display would be very useful if included to some 
degree within info or man pages. For the info pages, your example shows the 
analyses done to arrive at an output string. Are the debug messages directed to 
stderr?
 Regards 
 Leslie
 Mr. Leslie Satenstein
Montréal Québec, Canada



 
      From: Assaf Gordon <address@hidden>
 To: Pádraig Brady <address@hidden> 
Cc: Coreutils <address@hidden>
 Sent: Thursday, February 11, 2016 9:43 PM
 Subject: Re: suggested feautre: "date --debug" - print date parsing diagnostics
   
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






   

reply via email to

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