[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: suggested feautre: "date --debug" - print date parsing diagnostics
From: |
Pádraig Brady |
Subject: |
Re: suggested feautre: "date --debug" - print date parsing diagnostics |
Date: |
Sun, 24 Jan 2016 05:09:02 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 23/01/16 06:29, Assaf Gordon wrote:
> Attached yet another improvement, this time supporting detailed timezone
> information.
Yes it's definitely worth debugging the TZ stuff since
there are multiple ways to set it.
> Examples below, all examples run on a computer with default timezone of
> EST=-05:00 .
>
> Comments welcomed,
General notes on patch.
Spellings:
s/debug_print_relateive_time/debug_print_relative/ in gnulib commit msg
s/relatie/relative/
s/eigth/eight/
s/unambigious/unambiguous/
s/timezome/timezone/
s/modfied/modified/
Avoid -Werror=strict-prototypes
s/get_effective_timezone ()/get_effective_timezone (void)/
parse_datetime module needs to declare dependency on timegm module
prefer fn () to fn() calls in various places
%zu is not supported. See for example:
http://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=v8.23-75-g7d1fe88
> Explaining the 'bug' ( http://debbugs.gnu.org/22439 ) now becomes:
> ===
> $ ./src/date --debug -d '@0' +%X
> date: parsed timespec part: timespec=0 seconds
s/timespec/number of seconds/
s/timepec=//
> date: warning: default input timezone: -05:00
"warning" is a bit strong.
Note -u overrides TZ in the env which is not obvious, so maybe
we could say what input timezone is and where it came from?
This would also remove the need for a separate
"timezone modified by explicit TZ value" line. I.e.:
date: input timezone: ±HH:MM (set from $where)
$where can be:
--utc option
TZ=... in date string (to distinguish from TZ in env)
TZ=... environment value (good to print value as may be inherited)
system default
> date: final epoch-seconds: 0.000000000
> date: final date: '(Y-M-D) 1970-01-01 00:00:00' UTC
> date: final date: '(Y-M-D) 1969-12-31 19:00:00' (local TZ=-05:00)
> 19:00:00
thanks!
Pádraig