1834149 Members
2098 Online
110064 Solutions
New Discussion

tztab file format

 
Sharada
Occasional Contributor

tztab file format

In our application, we are making use of "/usr/lib/tztab" file like reading the file to get DST start and end dates based on the year and timezone. If the tztab format changes in future, then it affects our application.

We would like to know whether any chances in changing the tztab file format in future? If so is there any other way to get the spring ahead and fall back dates for the year and timezone(any system calls)?
5 REPLIES 5
DCE
Honored Contributor

Re: tztab file format



There is a patch for the DST changes. It will installed an updated tztab file. Hp is quite good about keeping it current

refer to the following link for the patch numbers

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1087883
Steve Steel
Honored Contributor

Re: tztab file format

Hi

HP is author of the tztab and it can always be changed if needed. However the basic format will remain the same.


See
http://www.chronos-st.org/Discovering%20the%20Local%20Time%20Zone--Why%20It's%20a%20Hard%20Problem.html


Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
James R. Ferguson
Acclaimed Contributor

Re: tztab file format

Hi:

Daylight Saving rules are political rules. Thus, I would suspect that you would hear about pending changes in many ways.

I doubt that there would be a change in the internal format of the file as used by HP-UX. The manpages for 'tztab(4)' offers the details you need.

If a change in rules occurs for any official would timezone, HP's ITRC patch database will hold an updated patch providing the new rule addendum. Search for a patch using the keyword 'tztab'.

Regards!

...JRF...
A. Clay Stephenson
Acclaimed Contributor

Re: tztab file format

It is state-of-the-art dumb to read tztab directly. It's possible for the format to change (though doubtful) but tztab is only found on HP-UX so portability just went out the window. What you should do is simply use the standard ctime() functions and search for when the time transitions occur. You will then know that all applications are okay. The attached perl script, dst.pl, uses localtime() to quickly home in on the time transitions via a binary search starting of epoch seconds within a year. It should be quite simple to convert the perl algorthihms to C or C++ or simply call the perl script from your application. Invoke as "dst.pl -u" for full usage.

If it ain't broke, I can fix that.
Dennis Handly
Acclaimed Contributor

Re: tztab file format

>Clay: It is state-of-the-art dumb to read tztab directly.

Exactly. I wrote this attached C source years ago to check out my Y2K changes. There are assumptions about when it changes that may have to be adjusted for other timezones/hemispheres.