Sei sulla pagina 1di 15


By: Akansh Gupta CSE 08B91A0505



3.Y2K Problem 4.What is the year 2038 bug? 5.How date & time calculated? 6.Consequences


Abbreviation for Y2K38 is adopted from Y2K. Acronym is accredited by Massachusetts programmer David Eddy. Y2K: Y=year; K=kilo or 1000(2k=2000). Also known as the Unix millennium bug or Y2K38 bug.

Overview: It may cause some computer software to fail before or in the year 2038.

At GMT,on 03:14:07 Tuesday,January19,2038,it is expected to see lot of things breaking magnificently.

Say,massive power outages, hospital life support system failures,phone system interruptions,bank problems etc.

The problem affect all the software and system that both store(use) system time as a 32-bit integer.

Y2K problem:
The year 2000 problem(also known as the Y2K problem,the millennium bug). A problem for both digital and non-digital documentation and data storage situation which resulted from practice of abbreviating a four-digit year to two.

As per Y2K bug, difference between 31 Dec 1999 and 1 Jan 2000 was 100 years.
The problem was related to a confusion between hexadecimal number encoding and binary-coded decimal(BCD)encoding of number. Both hexadecimal and BCD encode the numbers 0-9 as 0x0-0x9.

But BCD encodes the number 10 as 0x10,where as hexadecimal encodes the number 10 as 0x0A. 0x10 interpreted as a hexadecimal encoding representing the number 16.

Effected systems:Credit card terminal,some mobile phone terminals.


Y2K38 problem arises from programs not allocating enough bits to internal time. Unix internal time is commonly stored in a data structure using a long int containing the number of seconds since 1970. This time is used in all time-related processes such s scheduling, file timestamps etc. In a 32-bit machine, this value is sufficient to store time up to 19-jan-2038. After this date,32-bit clocks will overflow and return errorneous values such as 31-dec-1969 or 31-dec-1901.

How time & date are calculated?

Time_t is a data type used by C and C++ programs to represent dates and times internally. It is actually just an integer,a whole number that counts the number of seconds since January 1,1970 at 12:00 Am GMT. time_t value 0=12:00:00 AM (exactly midnight)1-Jan-1970. time_t value 1=12:00:01 AM (one second after midnight)1-Jan-1970.

Date & time 1-Jan-1970, 12:00:00 AM GMT 1-Jan-1970, 12:00:01 AM GMT 1-Jan-1970, 12:01:00 AM GMT

time_t representation 0 1 60

1-Jan-1970, 01:00:00 AM GMT

2-Jan-1970, 12:00:00 AM GMT 3-Jan-1970, 12:00:00 AM GMT 1-Feb-1970, 12:00:00 AM GMT 1-Mar-1970, 12:00:00 AM GMT 1-Jan-1971, 12:00:00 AM GMT 1-Jan-1972, 12:00:00 AM GMT 1-Jan-2003, 12:00:00 AM GMT 1-Jan-2038, 12:00:00 AM GMT 19-Jan-2038, 03:14:07 AM GMT

3 600
86 400 172 800 2 678 400 5 097 600 31 536 000 63 072 000 1 041 379 200 2 145 916 800 2 147 483 647

Modern 32-bit computer stores a signed integer data type , such as time_t ,in 32 bits
First bit specifies the 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 547

A time_t value of this exact number , represents Jan 19-2038 at 7 seconds past 3:14 Am GMT.

Scheduling software , billing programs , personal reminder calendars , clock circuits and other such pieces of codes that use to set dates fails. Process control computers , space probe computers , embedded systems in traffic light controllers , navigation systems.

Many data structures in use today have 32-bit time representations embedded into their structure.

There is no straight forward and general fix for this problem for existing CPU and OS combinations , existing file systems , or existing binary data formats. Adopt the 64-bit computers. In a 64-bit program, a time_t could represent any date and time in the future (which is available in the market). Upgrading a 32-bit machine into 64-bit machine is very expensive.

Solution to fix the problem is to redefine time_t as an unsigned integer instead of a signed integer.

The greatest danger with the year2038(Y2k38) is its invisibility. Software company will probably not think of trying out a year2038 scenario before dommsday strikes. The best way to predict the future is to engineer it. This can be done by developing 64-bit system which can take any date and time into consideration.