The year 2038 problem

I just found some information on an upcoming problem, the year 2038 problem. On that page is also an program to test whether your operating system has a problem or not.

In summary: the system time is usually stored as seconds since 1970 in a 32-bit register (or variable). On 2038-01-19 at 03:14:07 the register will overflow… . The solution is to switch to an 64-bit register (sufficient more than 4,000,000,000,000 years).

Usually not only the operating system has to be tuned, all time variables have to be large enough. 32 years aren’t that much for some programs (I’ve heard :-)). BIOS variants may also have problems on that day.

Some operations do have that problem now! Just think of an average of two dates after Jan 2004 (a+b)/2! a+b is already too large for 32 bits.

I couldn’t resist to check it on my systems

Linux currently has a problem, Mac OS X doesn’t.

Mac OS X Tiger on a G5

Tue Jan 19 03:14:01 2038
Tue Jan 19 03:14:02 2038
Tue Jan 19 03:14:03 2038
Tue Jan 19 03:14:04 2038
Tue Jan 19 03:14:05 2038
Tue Jan 19 03:14:06 2038
Tue Jan 19 03:14:07 2038
Tue Jan 19 03:14:07 2038
Tue Jan 19 03:14:07 2038
Tue Jan 19 03:14:07 2038

Mac OS X Tiger on a G4

Tue Jan 19 03:14:01 2038
Tue Jan 19 03:14:02 2038
Tue Jan 19 03:14:03 2038
Tue Jan 19 03:14:04 2038
Tue Jan 19 03:14:05 2038
Tue Jan 19 03:14:06 2038
Tue Jan 19 03:14:07 2038
Tue Jan 19 03:14:07 2038
Tue Jan 19 03:14:07 2038
Tue Jan 19 03:14:07 2038

Linux (Kernel 2.6.16)

Tue Jan 19 03:14:01 2038
Tue Jan 19 03:14:02 2038
Tue Jan 19 03:14:03 2038
Tue Jan 19 03:14:04 2038
Tue Jan 19 03:14:05 2038
Tue Jan 19 03:14:06 2038
Tue Jan 19 03:14:07 2038
Fri Dec 13 20:45:52 1901
Fri Dec 13 20:45:52 1901
Fri Dec 13 20:45:52 1901

We are at the very beginning of time for the human race. It is not unreasonable that we grapple with problems. But there are tens of thousands of years in the future. Our responsibility is to do what we can, learn what we can, improve the solutions, and pass them on.
— Richard Feynman

Comments

comments powered by Disqus