FW: timezone code - re-entrancy issue

lennox at cs.columbia.edu lennox at cs.columbia.edu
Wed Jan 14 23:49:10 UTC 2009

On Thursday, January 15 2009, "Robert Elz" wrote to "John Dlugosz, tz at lecserver.nci.nih.gov" saying:

> No, tm_zone (which I mistakenly called tm_tzname last time) is the
> "proper" way to get the abbreviation associated with a time_t
> (after a call to localtime() of course).  That one is perfectly safe
> (just call localtime_r() if you need it).

Actually, this isn't true -- tm_zone isn't safe if the value of the "TZ"
environment variable is changed.  (This is true even in single-threaded
code, in fact.)

Jonathan Lennox
lennox at cs.columbia.edu

More information about the tz mailing list