[tz] Embedding zone name in tzfile

Alan Barrett apb at cequrux.com
Thu Jan 31 07:48:07 UTC 2013

On Wed, 30 Jan 2013, Arthur David Olson wrote:
>> I recently added time zone support to our product, and life 
>> would have been easier if the time zone files had their file 
>> name in them so that they 'knew' what they were.
>> How come they don't?
> Some files have multiple names (as established by "Link" 
> directives).

One name could be blessed as the canonical name, and that could be
embedded in the file.

People sometimes want to know: What string could be stored in the 
TZ environment variable on this computer to cause it to use the 
time zone that is the default (described by /etc/localtime or 
similar) on some other computer?  If /etc/localtime is a symlink 
to /usr/share/zoneinfo/Foo/Bar, then the name "Foo/Bar" can easily 
be extracted from that, but if it's a copy instead of a symlink 
then I don't know of any easy answer.

--apb (Alan Barrett)

More information about the tz mailing list