[lug] Zoneinfo round-tripping?
Chris Riddoch
riddochc at gmail.com
Mon Mar 28 20:09:06 MDT 2016
Hi, folks.
This one's a bit of a puzzler for me - I'm getting similar behavior on
both Debian and Suse. It seems the zoneinfo databases don't have
files (or symlinks or any sort of references) to make it possible to
look up zoneinfo from all the timezone abbreviations - but it does for
some of them.
For example, 'zdump MST' and 'zdump EST' both return what I expected,
which caused me to think something that's apparently not true, because
'zdump MDT' and 'zdump EDT' indicate a lookup failure.
Should I not have expected the output of strftime's '%Z' to be a
string that I could look up in the zoneinfo database?
I guess I need to be using the longer strings for locations that
zoneinfo *can* look up, like "America/Denver", which Suse puts in
/etc/sysconfig/clock and Debian puts in /etc/timezone, and apparently
doesn't need to be stored in a TZ environment variable somehow. is
there a common API that can be used to look up that longer string
across (at least) Linux distros? Looking it up with strftime '%Z'
suddenly looks a lot less useful.
--
Chris Riddoch
http://www.syntacticsugar.org/
More information about the LUG
mailing list