The Year 2038 Bug! Recompile before it’s too late!
I was reading this article that claims that we should be prepared for the year 2038 bug! Yeah, you ‘ve heard right! The 2038 bug! After the famous Y2k Bug (a more trendy name for the Year 2000 Bug) there’s a new bug in town! As the article explains:
Time_t is a data type used in C/C and other languages based on C/C to represent/store dates and times internally. Time_t is actually just an integer that counts the number of seconds since January 1, 1970, at 12:00am GMT. If time_t is set to 0, it means the date and time is Jan 1, 1970, 12:00:00am. If the value of time_t is 60, the date and time will be Jan 1, 1970, 12:01:00am, and so on.
On Jan 19, 2038, 03:14:07am GMT, the t_time value will be 2147483647. This is the problem. All 32-bit computer systems store time_t in signed 32-bit integer. In other words, time_t can use a maximum of 32 bits. The first bit is used to indicate positive or negative state of the number, while other 31 bits are used to store the number itself. We can store no more than 2147483647 in 31 bits.
Also a PHP snippet that demonstrates the possibilities of this bug:
/* This is program is written by Amanat Ali Goher */
echo “Current T_time is : “. time() .”<br/>”;
echo “Current Date is : “. date(”r”) .”<br/>”;
echo “Date set : “. date(”r”, mktime(03,17, 07, 01, 19, 2005)) .”<br/>”;
echo “Now Setting Date to : 19-Jan-2038, 03:14:07″;
echo date(”M-d-Y”, mktime(03,17, 07, 01, 19, 2038));
So get ready before all the News Channels start bringing Computer experts to try and explain in plain English how this will affect us.
5 Responses to “The Year 2038 Bug! Recompile before it’s too late!”
Leave a Reply
MaSOn: file poli kali doulia .Den ime sinithismenos na xrisimopio wp alla ta themes sou...
Expressed on 1st of Nov 2007
Manali: what new sowftware should be indroduced in the ipod?
Expressed on 7th of Mar 2007
Rebecca: Cool blog, interesting information... Keep it UP »
Expressed on 1st of Mar 2007
Daniel2: i meant 3.000
Expressed on 23rd of Feb 2007
Daniel2: DANG! you sure doing a good effort, bloody 30,000 pounds!? this i dont see...
Expressed on 23rd of Feb 2007

HEhe nice post I highly doubt it that c or c++ or even z++ will be around until then. I think it is safe to say that armagedon will not be on 19th Jan 2038
/S
December 30th, 2005 at 6:48 pmIf I understand correctly, the bug only affects 32-bit computers … 64-bit processors are already out and they’re thus good forl 9,223,372,036,854,775,807 seconds, which means 64 bit computers are fine until Jan 25th 293,274,702,979 at 2:30:07pm GMT. That is far enough in the future not to concern ones self with. And while I’ve been surpised how slow 64-bit processors are being adopted today, they will have come and gone by 2038.
January 18th, 2006 at 11:49 pmYeah Garett I agree on that, but you know.. Every now and then something new must come up just for the publicity! It is though a potential risk that must be taken into consideration since similar bugs might appear soon.
January 22nd, 2006 at 11:05 pmTrue that it wont concern most people, but people who use online calendars etc… will want stuff to work after 2038 on the calendar. I have programmed a maintenance calendar into our company’s app and large construction companies use it to plan maintenance and job times etc.. Some of them even run it to after 2038 (when the calendar breaks down). So a workaround is needed. Its an online calendar programmed in php btw
February 16th, 2006 at 12:08 pmWell, beter that we know now then in 2037.
February 20th, 2006 at 12:10 am