Wednesday, July 8, 2009

Year2038 Problem

The year 2038 problem or unix millennium bug(same as y2k problem) may cause some computer software to fail before or in the year 2038. The problem affects all software and systems that store system time as a signed 32 bit integer .For the uninitiated, time_t is a data type used by C and C++ programs to represent dates and times internally. time_t is actually just an integer, a whole number, that counts the number of seconds since January 1, 1970 at 12:00 AM Greenwich Mean Time. A time_t value of 0 would be 12:00:00 AM (exactly midnight) 1-Jan-1970, a time_t value of 1 would be 12:00:01 AM (one second after midnight) 1-Jan-1970, etc.

By the year 2038, the time_t representation for the current time will be over 2 140 000 000. And that's the problem. A modern 32-bit computer stores a "signed integer" data type, such as time_t, in 32 bits. The first of these bits is used for the positive/negative sign of the integer, while the remaining 31 bits are used to store the number itself. The highest number these 31 data bits can store works out to exactly 2 147 483 647. A time_t value of this exact number, 2 147 483 647, represents January 19, 2038, at 7 seconds past 3:14 AM Greenwich Mean Time. So, at 3:14:07 AM GMT on that fateful day, every time_t used in a 32-bit C or C++ program will reach its upper limit.

One second later, on 19-January-2038 at 3:14:08 AM GMT, disaster strikes.

Share This!


DazzlingStars said...

Oh......'s a new knowledge to me.How it will overcome?

Arun V Pillai said...
This comment has been removed by the author.
Arun V Pillai said...

Yeah.. Now a days we are migrating to 64 bit operating systems(Ubuntu) and 64 bit processors(AMD Athlon). and the 2038 problem happens only in 32 bit os or programs. before 2038 the whole system will be using 64 bit os and processors.

Powered By Blogger · Designed By Seo Blogger Templates