Looking for non-TZ-dependent localtime()

Paul Eggert eggert at CS.UCLA.EDU
Wed Aug 4 06:18:40 UTC 2004


Michael Lindner <mlindner at idttechnology.com> writes:

> Is there a localtime()-like implementation out there that can do what
> I need, or do I have to write one?

I think the latter, unless you want to use Java
<http://www.bmsi.com/java/#TZ>.

Jonathan Lennox proposed a C API in
http://www.cl.cam.ac.uk/~mgk25/time/c/proposal-lennox.txt
I vaguely recall that something got implemented; perhaps
you can consult the archive of the tz mailing list.

> 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.)?

GNU/Linux (i.e., glibc) and tzcode are both reasonable.  Neither is
bug-free.  GNU/Linux currently has some problems with negative time
stamps; tzcode with large 64-bit time_t values -- choose your poison.
GNU/Linux is LPGLed and is probably more widely used; tzcode is public
domain.



More information about the tz mailing list