1 year ago
#343358
tom
Create TZ-File out of TZ-String
I want to create a TF-File for storing Unix Time Zone informations out of a TZ-String as define in POSIX 1003.1 section 8.3. It seems that timezone compiler zic does not cover this.
For a test I created a file "MYZ.txt" compatible to "zic" dealing with a phantasie time zone "MYZ=My Zone" with UTC offset +0:30 (or +1:30 in summer):
#TZ=MYZ-0:30MYSZ,M3.5.0/2,M10.5.0/3
Rule MYsummer min max - Mar lastSun 2:00w 1:00 MYSZ
Rule MYsummer min max - Oct lastSun 3:00w 0 MYZ
Zone MYZ 0:30 MYsummer %s
The commented first line has the same information as the two rules and Zone information below.
zic MYZ.txt -d /tmp
does what I want and stores the time zone information into "/tmp/MYZ".
What I like to use is something like calling
export TZ=MYZ-0:30MYSZ,M3.5.0/2,M10.5.0/3
zic -d /tmp
and having the same time zone information in "/tmp/MYZ" like above.
Of corse I could implement a tool creating "MYZ.txt" out of the TZ environment variable. But I guess somthing similar is avaible within the UNIX/Linux standard tools.
This may be realted to TZ Variable, custom file .
Thanks for any help,
Tom
linux
unix
timezone
timezone-offset
0 Answers
Your Answer