Re: Algorithm to exploit 32 bit time functions to do time zone calculations

Michael G Schwern <[email protected]> Tue, 16 Sep 2008 13:09:52 -0700
Newsgroups gmane.comp.lib.libtai
Message-ID <[email protected]>
Thorsten Glaser wrote:
> Michael G Schwern dixit:
> 
>> Instead, I am rewriting the time.h library functions to be 2038-clean.  The
> 
> *yawn*

Me:  "Hey, I have this great idea that might help out!"
You: "Your shit is boring."

This is the sort of reply one gets when offering help?  What a jackass.


> MirBSD uses a 64-bit time_t type on i386 (ILP32), with the aid
> of tm2mjd and mjd2tm functions from DJB libtai code. The rest of the
> functions from the time library work just fine…

If I understand correctly, that's an entire operating system.

The target for y2038 is people writing portable applications which don't have
the luxury of waiting for every OS to upgrade to a 64 bit time_t.  It works
with a 32 bit time_t and it handles time zones.

This is something, as I understand it, that libtai does not do (this is the
impression I get, please correct me if I'm wrong) and I'm offering a way that
it could.

Also you might want to have a look at the tests in y2038.  libtai's INSTALL
says it's not very well tested and what it has appears to be manual.  y2038
has automated tests with extensive testing data files for expected gmtime()
and localtime() results.  You might be able to adapt that data and also the
tap.c test library to make writing tests easy.

Or is that too boring?


-- 
If at first you don't succeed--you fail.
	-- "Portal" demo