[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: unix time hits the bigtime



On Thu, 9 Jul 1998, Ira Abramov wrote:

> time on Unix machines is counted in seconds (I believe since 12am, January
> 1 1970), and today it turned 900,000,000.
> 
> by a strange coincidance, it happend at exactly 9:00:00 Pacific time on
> the 9th day of July :-) (my local time)

Buy a Lotto ticket with that number.
 
> as an aside: Unix systems are generally Y2K compatable since they only
> count seconds and not years, and it's mainly the applications that have

Unix systems are indeed, but PC-based ones are NOT NECESSARILY so. Check
your BIOS out before things go wrong. I have outlined the how in another
email to this list.

> problems (my favourite Email program, PINE, just came out with a Y2K fix
> this week). 

What did (will) the bug do. I also use PINE. 

> Unix time is defined as a long int (31 bits and a sign bit on 
> most systems) which means basically that it too will end circa 2038, and
> cause as much confusion if not more, as the Y2K bug is causing today...

There are at least 2 fixes that will make it work nevertheless:

1. Cast the time to unsigned, which extends the period of grace to 2106
and remains fully compatible, with some small quirks on long time-spans
(difftime results of more than 2^31) (I'll be certainly dead by then so
it's good for me ;)  

2. Augment the time_t type in a compatible way to be 64 bits long. This is
probably the long-term solution. Old apps will still read the new time_t
'right' because of the 'auto' casting capability of C in an expression. 
 
Peter