Proposal: API for thread-safe time zone functions

Jonathan Lennox lennox at
Thu Jun 7 16:09:33 UTC 2001

One of the major shortcomings of the current time zone API defined by ISO C
and POSIX is that they rely on global data to define the current time zone.
If you're writing a server program which needs to talk to people all over
the world in their local time zones, this can lead to remarkable

Therefore, I've written up a proposal (attached) for a thread-safe API for
time zone functions.  These extend (I think) the current time API in a
natural way.  There are two forms: one purely re-entrant, and another one
that specifies thread-local timezone data to be used by the existing
time functions.

I've drawn a lot of inspiration for this work from Ulrich Drepper's work on
thread-aware POSIX locales (

* Are people interested in this?
* Do people think that my proposal is a sensible API?
* Would people be interested in seeing the resulting code?
* Would people be interested in helping write the code?
* Would the resulting code (assuming it's written sensibly) be
  acceptable/appropriate for incorporation into tzcode?

Comments very welcome!

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: proposal.txt
URL: <>
-------------- next part --------------

Jonathan Lennox
lennox at

More information about the tz mailing list