Problems with timezone & altzone values

Madhusudanan Kandasamy madhusudanan at
Thu Mar 18 11:01:21 UTC 2010

Hi Olson,

As per POSIX standard timezone variable should be updated by tzset(), but 
its obvious that timezone values depends on what is the current time and 
during tzset() we won't be knowing the current time. So, for many 
countries, we are getting a wrong values for timezone and altzone for the 
current time. Hence is it possible to update the timezone and altzone 
values in localtime(), so atleast after calling the localtime we would be 
getting the correct values for both of these variables?

The other solution would be to call time() in tzset(), and update the 
altzone, timezone variables in tzset itself. This will have little 
performance overhead, but we would be having a accurate values w.r.t 
current system time. This new feature could be under a #ifdef macros, so 
it can be enabled only for the people who are wants these variables to be 
updated in tzset itself but with a performance penalty.

Also, is there any way available to get accurate values for these 
variables with the current version of the code?

Madhusudanan Kandasamy
AIX BOS Development,
IBM Bangalore, EGL D block 6th Floor.
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the tz mailing list