[tz] zdump new option -i for easier-to-review output

Paul Eggert eggert at cs.ucla.edu
Tue Jun 7 08:44:11 UTC 2016


Tim Parenti wrote:

> I realize the goal may be to have a single canonical format, but perhaps
> this could be made conditional on a -z option?

Yes, or some such option like that. I was thinking more of a strftime-like 
format in which one could specify UT vs local time.


> Just to throw in a potential middle-of-the-road option, would it make sense
> to space-pad the datetime and offset values instead?

I thought of doing that, but found that it would be a pain, since the amount of 
padding would be system-dependent. Every field whose extrema depend on machine 
integer size (the year, the UT offset) would have a width that would depend on 
the current machine architecture, and this would mean zdump -i would generate 
different outputs on different machine architectures. Plus, there would be a lot 
of spaces before the year and the UT offsets.

Alternatively, zdump could look at all output to be generated for this 
particular zdump run, compute the maximum width needed for the run, and use that 
width. But this would mean that 'zdump -i A; zdump -i B' would not necessarily 
output the same thing as 'zdump -i A B', which would not be good at all.

Alternatively, zdump could not bother to align outlandish years outside the 
range -999,9999 or outlandish UT offsets that are more than 100 hours away from 
UT. Something like that might work, I suppose, though we'd probably still get 
bug reports from compulsive aligners wondering why the outlandish cases aren't 
aligned properly, or why there's all that white space in the columns.


More information about the tz mailing list