Bug 207345 - zdump(8): zdump -c has an opposite behavior, in my xterm: lower bound is inclusive ...
Summary: zdump(8): zdump -c has an opposite behavior, in my xterm: lower bound is incl...
Status: RESOLVED CODE_FIX
Alias: None
Product: Documentation
Classification: Unclassified
Component: man-pages (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: documentation_man-pages@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-18 19:49 UTC by Marco Curreli
Modified: 2020-04-27 05:38 UTC (History)
2 users (show)

See Also:
Kernel Version:
Subsystem:
Regression: No
Bisected commit-id:


Attachments
0001-Clarify-zdump-c.patch (1.23 KB, text/x-patch)
2020-04-23 23:05 UTC, Paul Eggert
Details

Description Marco Curreli 2020-04-18 19:49:06 UTC
In zdump(8)from man-pages-5.06, row 81 (zdump -c) and row 98 (zdump -t):
The lower bound is exclusive and the upper is inclusive.

In my terminal (xterm) this command has an opposte behavior:

[marco@casa man]$ zdump -c 2018,2020 -i Europe/Rome Europe/London

TZ="Europe/Rome"
-       -       +01     CET
2018-03-25      03      +02     CEST    1
2018-10-28      02      +01     CET
2019-03-31      03      +02     CEST    1
2019-10-27      02      +01     CET

TZ="Europe/London"
-       -       +00     GMT
2018-03-25      02      +01     BST     1
2018-10-28      01      +00     GMT
2019-03-31      02      +01     BST     1
2019-10-27      01      +00     GMT
Comment 1 Michael Kerrisk 2020-04-23 12:29:54 UTC
My guess is this: in "-c 2018,2020", 2018 is translated to the seconds
equivalent of '2018-01-01 00:00:00" and likewise for 2020. And though
the seconds range may be treated as low-bound-exclusive plus
high-bound-inclusive, the user is easily confused, because the output
*looks like* low-bound-year-inclusive plus high-bound-year-inclusive.

I've sent a mail with you in CC; perhaps Paul Eggert can help us.
Comment 2 Paul Eggert 2020-04-23 23:05:26 UTC
Created attachment 288689 [details]
0001-Clarify-zdump-c.patch

I installed the attached doc patch to tzdb try to clarify things. The documented
zdump behavior is kind of weird, but now's not the time to change it as we're
about to do a new tzdb release.
Comment 3 Michael Kerrisk 2020-04-24 14:15:19 UTC
On Fri, 24 Apr 2020 at 00:57, Paul Eggert <eggert@cs.ucla.edu> wrote:
>
> I installed the attached doc patch to tzdb try to clarify things. The
> documented
> zdump behavior is kind of weird, but now's not the time to change it as we're
> about to do a new tzdb release.

Thanks, Paul. If you wold be so nice as to drop me a note when the
release is done, I will resync that pages in man-pages.

Thanks,

Michael
Comment 4 Michael Kerrisk 2020-04-27 05:38:13 UTC
I've updated to the lastest zdump.8 upstream page, which now says:

Cutoffs  are  at  the  start of each year, where the lower-
              bound timestamp is exclusive and the  upper  is  inclusive;
              for   example,   -c  1970,2070  selects  transitions  after
              1970-01-01  00:00:00  UTC  and  on  or  before   2070-01-01
              00:00:00 UTC.

Thanks to that change from Paul Eggert, I think this bug can now be closed, and I'm doing so now.

Note You need to log in before you can comment on or make changes to this bug.