[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, 4 Feb 2016 23:28:39 -0500 |
Hello Pádraig,
> On Jan 24, 2016, at 00:09, Pádraig Brady <address@hidden> wrote:
>
> Yes it's definitely worth debugging the TZ stuff since
> there are multiple ways to set it.
Thank you for the review and feedback.
Attached are improved patches:
coreutils-debug-date.v4.patch
Description: Binary data
gnulib-debug-date.v4.patch
Description: Binary data
With the above patch, both input timezone and output timezone are printed.
The following script illustrates:
date-TZ-variants.sh
Description: Binary data
Comments welcomed,
- assaf
== date --debug -d " 09:30:21 " ==
date: parsed time part: 09:30:21
date: input timezone: -05:00 (set from system default)
date: using specified time as starting value: '09:30:21'
date: using current date as starting value: '(Y-M-D) 2016-02-04'
date: starting date/time: '(Y-M-D) 2016-02-04 09:30:21 TZ=-05:00'
date: '(Y-M-D) 2016-02-04 09:30:21 TZ=-05:00' = 1454596221 epoch-seconds
date: output timezone: -05:00 (set from system default)
date: final epoch-seconds: 1454596221.000000000
date: final date: '(Y-M-D) 2016-02-04 14:30:21' (UTC0)
date: final date: '(Y-M-D) 2016-02-04 09:30:21' (Output timezone TZ=-05:00)
Thu Feb 4 09:30:21 EST 2016
== date --debug -d " 09:30:21 +03:00" ==
date: parsed time part: 09:30:21 TZ=+03:00
date: input timezone: +03:00 (set from parsed date/time string)
date: using specified time as starting value: '09:30:21'
date: using current date as starting value: '(Y-M-D) 2016-02-04'
date: starting date/time: '(Y-M-D) 2016-02-04 09:30:21 TZ=+03:00'
date: '(Y-M-D) 2016-02-04 09:30:21 TZ=+03:00' = 1454596221 epoch-seconds
date: after timezone adjustment (+180 minutes),
date: new time = 1454567421 epoch-seconds
date: output timezone: -05:00 (set from system default)
date: final epoch-seconds: 1454567421.000000000
date: final date: '(Y-M-D) 2016-02-04 06:30:21' (UTC0)
date: final date: '(Y-M-D) 2016-02-04 01:30:21' (Output timezone TZ=-05:00)
Thu Feb 4 01:30:21 EST 2016
== date --debug -d "TZ="Asia/Tokyo" 09:30:21 " ==
date: parsed time part: 09:30:21
date: input timezone: +09:00 (set from TZ='Asia/Tokyo' in date string)
date: using specified time as starting value: '09:30:21'
date: using current date as starting value: '(Y-M-D) 2016-02-04'
date: starting date/time: '(Y-M-D) 2016-02-04 09:30:21 TZ=+09:00'
date: '(Y-M-D) 2016-02-04 09:30:21 TZ=+09:00' = 1454545821 epoch-seconds
date: output timezone: -05:00 (set from system default)
date: final epoch-seconds: 1454545821.000000000
date: final date: '(Y-M-D) 2016-02-04 00:30:21' (UTC0)
date: final date: '(Y-M-D) 2016-02-03 19:30:21' (Output timezone TZ=-05:00)
Wed Feb 3 19:30:21 EST 2016
== date --debug -d "TZ="Asia/Tokyo" 09:30:21 +03:00" ==
date: parsed time part: 09:30:21 TZ=+03:00
date: input timezone: +03:00 (set from parsed date/time string)
date: using specified time as starting value: '09:30:21'
date: using current date as starting value: '(Y-M-D) 2016-02-04'
date: starting date/time: '(Y-M-D) 2016-02-04 09:30:21 TZ=+03:00'
date: '(Y-M-D) 2016-02-04 09:30:21 TZ=+03:00' = 1454545821 epoch-seconds
date: after timezone adjustment (+180 minutes),
date: new time = 1454567421 epoch-seconds
date: output timezone: -05:00 (set from system default)
date: final epoch-seconds: 1454567421.000000000
date: final date: '(Y-M-D) 2016-02-04 06:30:21' (UTC0)
date: final date: '(Y-M-D) 2016-02-04 01:30:21' (Output timezone TZ=-05:00)
Thu Feb 4 01:30:21 EST 2016
== date --debug -u -d " 09:30:21 " ==
date: parsed time part: 09:30:21
date: input timezone: +00:00 (set from TZ=UTC0 envionment value or --utc)
date: using specified time as starting value: '09:30:21'
date: using current date as starting value: '(Y-M-D) 2016-02-05'
date: starting date/time: '(Y-M-D) 2016-02-05 09:30:21 TZ=+00:00'
date: '(Y-M-D) 2016-02-05 09:30:21 TZ=+00:00' = 1454664621 epoch-seconds
date: output timezone: +00:00 (set from TZ=UTC0 envionment value or --utc)
date: final epoch-seconds: 1454664621.000000000
date: final date: '(Y-M-D) 2016-02-05 09:30:21' (UTC0)
date: final date: '(Y-M-D) 2016-02-05 09:30:21' (Output timezone TZ=+00:00)
Fri Feb 5 09:30:21 UTC 2016
== date --debug -u -d " 09:30:21 +03:00" ==
date: parsed time part: 09:30:21 TZ=+03:00
date: input timezone: +03:00 (set from parsed date/time string)
date: using specified time as starting value: '09:30:21'
date: using current date as starting value: '(Y-M-D) 2016-02-05'
date: starting date/time: '(Y-M-D) 2016-02-05 09:30:21 TZ=+03:00'
date: '(Y-M-D) 2016-02-05 09:30:21 TZ=+03:00' = 1454664621 epoch-seconds
date: after timezone adjustment (+180 minutes),
date: new time = 1454653821 epoch-seconds
date: output timezone: +00:00 (set from TZ=UTC0 envionment value or --utc)
date: final epoch-seconds: 1454653821.000000000
date: final date: '(Y-M-D) 2016-02-05 06:30:21' (UTC0)
date: final date: '(Y-M-D) 2016-02-05 06:30:21' (Output timezone TZ=+00:00)
Fri Feb 5 06:30:21 UTC 2016
== date --debug -u -d "TZ="Asia/Tokyo" 09:30:21 " ==
date: parsed time part: 09:30:21
date: input timezone: +09:00 (set from TZ='Asia/Tokyo' in date string)
date: using specified time as starting value: '09:30:21'
date: using current date as starting value: '(Y-M-D) 2016-02-05'
date: starting date/time: '(Y-M-D) 2016-02-05 09:30:21 TZ=+09:00'
date: '(Y-M-D) 2016-02-05 09:30:21 TZ=+09:00' = 1454632221 epoch-seconds
date: output timezone: +00:00 (set from TZ=UTC0 envionment value or --utc)
date: final epoch-seconds: 1454632221.000000000
date: final date: '(Y-M-D) 2016-02-05 00:30:21' (UTC0)
date: final date: '(Y-M-D) 2016-02-05 00:30:21' (Output timezone TZ=+00:00)
Fri Feb 5 00:30:21 UTC 2016
== date --debug -u -d "TZ="Asia/Tokyo" 09:30:21 +03:00" ==
date: parsed time part: 09:30:21 TZ=+03:00
date: input timezone: +03:00 (set from parsed date/time string)
date: using specified time as starting value: '09:30:21'
date: using current date as starting value: '(Y-M-D) 2016-02-05'
date: starting date/time: '(Y-M-D) 2016-02-05 09:30:21 TZ=+03:00'
date: '(Y-M-D) 2016-02-05 09:30:21 TZ=+03:00' = 1454632221 epoch-seconds
date: after timezone adjustment (+180 minutes),
date: new time = 1454653821 epoch-seconds
date: output timezone: +00:00 (set from TZ=UTC0 envionment value or --utc)
date: final epoch-seconds: 1454653821.000000000
date: final date: '(Y-M-D) 2016-02-05 06:30:21' (UTC0)
date: final date: '(Y-M-D) 2016-02-05 06:30:21' (Output timezone TZ=+00:00)
Fri Feb 5 06:30:21 UTC 2016
== TZ=America/Belize date --debug -d " 09:30:21 " ==
date: parsed time part: 09:30:21
date: input timezone: -06:00 (set from TZ='America/Belize' environment value)
date: using specified time as starting value: '09:30:21'
date: using current date as starting value: '(Y-M-D) 2016-02-04'
date: starting date/time: '(Y-M-D) 2016-02-04 09:30:21 TZ=-06:00'
date: '(Y-M-D) 2016-02-04 09:30:21 TZ=-06:00' = 1454599821 epoch-seconds
date: output timezone: -06:00 (set from TZ='America/Belize' environment value)
date: final epoch-seconds: 1454599821.000000000
date: final date: '(Y-M-D) 2016-02-04 15:30:21' (UTC0)
date: final date: '(Y-M-D) 2016-02-04 09:30:21' (Output timezone TZ=-06:00)
Thu Feb 4 09:30:21 CST 2016
== TZ=America/Belize date --debug -d " 09:30:21 +03:00" ==
date: parsed time part: 09:30:21 TZ=+03:00
date: input timezone: +03:00 (set from parsed date/time string)
date: using specified time as starting value: '09:30:21'
date: using current date as starting value: '(Y-M-D) 2016-02-04'
date: starting date/time: '(Y-M-D) 2016-02-04 09:30:21 TZ=+03:00'
date: '(Y-M-D) 2016-02-04 09:30:21 TZ=+03:00' = 1454599821 epoch-seconds
date: after timezone adjustment (+180 minutes),
date: new time = 1454567421 epoch-seconds
date: output timezone: -06:00 (set from TZ='America/Belize' environment value)
date: final epoch-seconds: 1454567421.000000000
date: final date: '(Y-M-D) 2016-02-04 06:30:21' (UTC0)
date: final date: '(Y-M-D) 2016-02-04 00:30:21' (Output timezone TZ=-06:00)
Thu Feb 4 00:30:21 CST 2016
== TZ=America/Belize date --debug -d "TZ="Asia/Tokyo" 09:30:21 " ==
date: parsed time part: 09:30:21
date: input timezone: +09:00 (set from TZ='Asia/Tokyo' in date string)
date: using specified time as starting value: '09:30:21'
date: using current date as starting value: '(Y-M-D) 2016-02-04'
date: starting date/time: '(Y-M-D) 2016-02-04 09:30:21 TZ=+09:00'
date: '(Y-M-D) 2016-02-04 09:30:21 TZ=+09:00' = 1454545821 epoch-seconds
date: output timezone: -06:00 (set from TZ='America/Belize' environment value)
date: final epoch-seconds: 1454545821.000000000
date: final date: '(Y-M-D) 2016-02-04 00:30:21' (UTC0)
date: final date: '(Y-M-D) 2016-02-03 18:30:21' (Output timezone TZ=-06:00)
Wed Feb 3 18:30:21 CST 2016
== TZ=America/Belize date --debug -d "TZ="Asia/Tokyo" 09:30:21 +03:00" ==
date: parsed time part: 09:30:21 TZ=+03:00
date: input timezone: +03:00 (set from parsed date/time string)
date: using specified time as starting value: '09:30:21'
date: using current date as starting value: '(Y-M-D) 2016-02-04'
date: starting date/time: '(Y-M-D) 2016-02-04 09:30:21 TZ=+03:00'
date: '(Y-M-D) 2016-02-04 09:30:21 TZ=+03:00' = 1454545821 epoch-seconds
date: after timezone adjustment (+180 minutes),
date: new time = 1454567421 epoch-seconds
date: output timezone: -06:00 (set from TZ='America/Belize' environment value)
date: final epoch-seconds: 1454567421.000000000
date: final date: '(Y-M-D) 2016-02-04 06:30:21' (UTC0)
date: final date: '(Y-M-D) 2016-02-04 00:30:21' (Output timezone TZ=-06:00)
Thu Feb 4 00:30:21 CST 2016
== TZ=America/Belize date --debug -u -d " 09:30:21 " ==
date: parsed time part: 09:30:21
date: input timezone: +00:00 (set from TZ=UTC0 envionment value or --utc)
date: using specified time as starting value: '09:30:21'
date: using current date as starting value: '(Y-M-D) 2016-02-05'
date: starting date/time: '(Y-M-D) 2016-02-05 09:30:21 TZ=+00:00'
date: '(Y-M-D) 2016-02-05 09:30:21 TZ=+00:00' = 1454664621 epoch-seconds
date: output timezone: +00:00 (set from TZ=UTC0 envionment value or --utc)
date: final epoch-seconds: 1454664621.000000000
date: final date: '(Y-M-D) 2016-02-05 09:30:21' (UTC0)
date: final date: '(Y-M-D) 2016-02-05 09:30:21' (Output timezone TZ=+00:00)
Fri Feb 5 09:30:21 UTC 2016
== TZ=America/Belize date --debug -u -d " 09:30:21 +03:00" ==
date: parsed time part: 09:30:21 TZ=+03:00
date: input timezone: +03:00 (set from parsed date/time string)
date: using specified time as starting value: '09:30:21'
date: using current date as starting value: '(Y-M-D) 2016-02-05'
date: starting date/time: '(Y-M-D) 2016-02-05 09:30:21 TZ=+03:00'
date: '(Y-M-D) 2016-02-05 09:30:21 TZ=+03:00' = 1454664621 epoch-seconds
date: after timezone adjustment (+180 minutes),
date: new time = 1454653821 epoch-seconds
date: output timezone: +00:00 (set from TZ=UTC0 envionment value or --utc)
date: final epoch-seconds: 1454653821.000000000
date: final date: '(Y-M-D) 2016-02-05 06:30:21' (UTC0)
date: final date: '(Y-M-D) 2016-02-05 06:30:21' (Output timezone TZ=+00:00)
Fri Feb 5 06:30:21 UTC 2016
== TZ=America/Belize date --debug -u -d "TZ="Asia/Tokyo" 09:30:21 " ==
date: parsed time part: 09:30:21
date: input timezone: +09:00 (set from TZ='Asia/Tokyo' in date string)
date: using specified time as starting value: '09:30:21'
date: using current date as starting value: '(Y-M-D) 2016-02-05'
date: starting date/time: '(Y-M-D) 2016-02-05 09:30:21 TZ=+09:00'
date: '(Y-M-D) 2016-02-05 09:30:21 TZ=+09:00' = 1454632221 epoch-seconds
date: output timezone: +00:00 (set from TZ=UTC0 envionment value or --utc)
date: final epoch-seconds: 1454632221.000000000
date: final date: '(Y-M-D) 2016-02-05 00:30:21' (UTC0)
date: final date: '(Y-M-D) 2016-02-05 00:30:21' (Output timezone TZ=+00:00)
Fri Feb 5 00:30:21 UTC 2016
== TZ=America/Belize date --debug -u -d "TZ="Asia/Tokyo" 09:30:21 +03:00" ==
date: parsed time part: 09:30:21 TZ=+03:00
date: input timezone: +03:00 (set from parsed date/time string)
date: using specified time as starting value: '09:30:21'
date: using current date as starting value: '(Y-M-D) 2016-02-05'
date: starting date/time: '(Y-M-D) 2016-02-05 09:30:21 TZ=+03:00'
date: '(Y-M-D) 2016-02-05 09:30:21 TZ=+03:00' = 1454632221 epoch-seconds
date: after timezone adjustment (+180 minutes),
date: new time = 1454653821 epoch-seconds
date: output timezone: +00:00 (set from TZ=UTC0 envionment value or --utc)
date: final epoch-seconds: 1454653821.000000000
date: final date: '(Y-M-D) 2016-02-05 06:30:21' (UTC0)
date: final date: '(Y-M-D) 2016-02-05 06:30:21' (Output timezone TZ=+00:00)
Fri Feb 5 06:30:21 UTC 2016
- Re: suggested feautre: "date --debug" - print date parsing diagnostics,
Assaf Gordon <=