On Tuesday, August 3 2004, "Michael Lindner" wrote to "Tz" saying:
I have a multithreaded server that has a thread per client, and needs to talk to clients in their local timezone. All the "normal" UNIX time functions rely on "TZ" for timezone information, so even though they're nominally "thread-safe" they don't support my application, since TZ is global across threads.
Is there a localtime()-like implementation out there that can do what I need, or do I have to write one? And if not and I have to write one, what code base is the "correct" one to start from (e.g. Linux, tzcode2003e.tar.gz from elsi.nci.nih.gov, etc.)?
I implemented one a while back, based on the then-current version of tzcode with some input from its FreeBSD variant. I've attached my message implementing it below. It's based on tzcode2001c. It might be a bit of work to update it to the current version of tzcode; I've not tried it. Licensed under the standard tzcode license, i.e. public domain. For discussion of it, check out the archives of the tz list from June 2001.