The Year-2038 Bug


Home
Demo
Developers
64-bit
Contact

      A web site devoted to disseminating information about the year-2038 bug

What can I do as a developer?

The first thing is to start campaigning for solutions to this problem. Petition major software vendors to start planning now.

Try wherever possible to use large types for storing dates in databases: 64-bits is sufficient - a long long type in GNU C and POSIX/SuS.

Make sure your use of time_t is consistent throughout your code. Always use the Operating System vendor's standard functions to convert times and use them exactly as directed by their documentation. Never cast time values to any type except the standard types provided by your system libraries. This way, when your code gets recompiled on newer systems, the bugs will naturally go away.

A version of gmtime() that works around the 2038 bug can be found here, with useful ranges of various functions shown in this table.

Use the TAI library by Dan Bernstein. This library copes with the time problem properly.