Bharat Banate's Work Profile

View Bharat Banate's profile on LinkedIn

Monday, December 3, 2007

The Year 2038 Bug

It's barely 8 years since we had the millenium bug so don't say you didn't get enough warning! A lot of systems in the world may have date rollover troubles in a fraction over 30 years time. The millenium bug (more accurately known as the Two Digit Century Rollover Bug) was caused by using 2 digits instead of 4 for the year. So Christmas 2007 falls on 12/25/07. Of course when 1999 rolled over to 2000 then the first day of the new century became 01/01/00 and this could have had serious consequences had all the old systems not been sorted out in advance. This problem will also happen again in 2099, 2199 etc if anyone is silly enough to keep using two digit year dates.

But the Unix bug will occur in 2038. That's because the date system started in 1970 and uses a time_t (signed int) to hold the number of seconds. The highest value is 2147483648-1 which is 24855.13 days. Add that to Jan 1 1970 and you get Jan 19 2038! So sometime early on that morning of that date, any software using a signed int for a date will rollover to Jan 1 1970! So how you are going to cope up with this problem dudes....!!!

3 comments:

Anonymous said...

Hi sacheen, this topic is already on the blog. Check out this link given below:
http://sanganakjidnyasa.blogspot.com/2007/09/news-world-will-end-on-january-19-2038.html

I have also put a small perl program to check how unix system will report the date in case of 2038 bug.

:)

Anonymous said...

Hi, the URL I put in above comment is not clearly visible.
Just check out post titled: World will end on Janury 19, 2038.

Anonymous said...

The precise date of this occurrence is Tue Jan 19 03:14:07 2038. At this time, a machine prone to this bug will show the time Fri Dec 13 20:45:52 1901, hence it is possible that the media will call this The Friday 13th Bug.