Looking for non-TZ-dependent localtime()
lennox at cs.columbia.edu
Wed Aug 4 01:28:33 UTC 2004
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.
-------------- next part --------------
An embedded message was scrubbed...
From: Jonathan Lennox <lennox at cs.columbia.edu>
Subject: Thread-safe timezones: running code
Date: Mon, 18 Jun 2001 16:57:42 -0400 (EDT)
More information about the tz