[lug] Zoneinfo round-tripping?
Orion Poplawski
orion at cora.nwra.com
Mon Mar 28 20:17:01 MDT 2016
On 03/28/2016 08:09 PM, Chris Riddoch wrote:
> 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.
>
ls /usr/share/zoneinfo on my system suggests names like: MST7MDT,
EST5EDT for the daylight savings time observing zones.
--
Orion Poplawski
Technical Manager 303-415-9701 x222
NWRA/CoRA Division FAX: 303-415-9702
3380 Mitchell Lane orion at cora.nwra.com
Boulder, CO 80301 http://www.cora.nwra.com
More information about the LUG
mailing list