Seminar Report 2004 - 2005
Seminar Report 2004 - 2005
Y2K38
1. INTRODUCTION
January 19, 2038 will be a serious problem for many platforms, because these
systems will "run out of time". Starting at GMT 03:14:07, Tuesday, January 19, 2038,it is
fully expect to see lots of things breaking magnificently: satellites falling out of orbit, massive
power outages, hospital life support system failures, phone system interruptions, bank
problems, etc. That's because one second later, many of these systems will have wildly
inaccurate date settings, producing all kinds of unpredictable consequences. In short, many
of the dire predictions for the year 2000 are much more likely to actually occur in the year
2038. Most programs written in the C programming language are relatively immune to the
Y2K problem, but suffer instead from the Year 2038 problem. This problem arises because
most C programs use a library of routines called the standard time library (time.h). This
library establishes a standard 4-byte format for the storage of time values, and also
provides a number of functions for converting, displaying and calculating time values. a
signed 4-byte integer has a maximum value of 2,147,483,647, and this is where the Year
2038 problem comes from. The maximum value of time before it rolls over to a negative
translates into 19-January-2038 at 3:14:08 AM GMT On this date, any C programs that use
the standard time library will start to have problems with date calculations. Because of its
high compactness it is the mainly used embedded software. So y2k38 not only affects the
computers, but also many embedded systems. The year 2000 was just a dry run. In case
you think we can sit on this issue for another 30 years before addressing it, consider that
the temporal echo’s of the 2038 problem are already starting to appear in date calculations
for mortgages and vital statistics. One second later, on 19- January-2038 at 3:14:08 AM
Just as Y2K problems arise from programs not allocating enough digits to the year,
Y2K38 problems arise from programs not allocating enough bits to internal time. time_t is a
data type used by C and C++ programs to represent dates and times internally Most
programs written in the C programming language are relatively immune to the Y2K problem,
but suffer instead from the Year 2038 problem. This problem arises because most C
programs use a library of routines called the standard time library (time.h). This library
establishes a standard 4-byte format for the storage of time values, and also provides a
Y2K38
calculating time values. It is the basis for the CTime and CTimeSpan classes in MFC.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. After this date, 32-bit clocks will overflow and return erroneous values
only used as computer software but it is also used in many electronic chips. Because of its
high compactness it is the mainly used embedded software. Satellites, space probe
computers, navigation systems, power plants, atom bombs, missile controllers and many
other important fields contains embedded systems which uses these kinds of chips. So after
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
Jan-1970, etc... Since one year lasts for a little over 31 536 000 seconds, the time_t
representation of January 1, 1971 is about 31 536 000, the time_t representation for
By the year 2038, the time_t representation for the current time will be over
2140000000. 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
odometer. When a 5-digit odometer reaches 99 999 miles, and then the driver goes one
Y2K38
when a signed integer reaches its maximum value and then gets incremented, it wraps
around to its lowest possible negative value. (The reasons for this have to do with a binary
notation called "two's complement"; I won't bore you with the details here.) This means a
32-bit signed integer, such as a time_t, set to its maximum value of 2 147 483 647 and then
incremented by 1, will become -2 147 483 648. Note that "-" sign at the beginning of this
large number. A time_t value of -2 147 483 648 would represent December 13, 1901 at
8:45:52 PM GMT.
So, if all goes normally, 19-January-2038 will suddenly become 13- December-1901
in every time_t across the globe, and every date calculation based on this figure will go
haywire. And it gets worse. Most of the support functions that use the time_t data type
cannot handle negative time_t values at all. They simply fail and return an error code. Now,
most "good" C and C++ programmers know that they are supposed to write their programs
in such a way that each function call is checked for an error return, so that the program will
still behave nicely even when things don't go as planned. But all too often, the simple, basic,
everyday functions they call will "almost never" return an error code, so an error condition
simply isn't checked for. It would be too tedious to check everywhere; and besides, the
extremely rare conditions that result in the function's failure would "hardly ever" happen in
the real world. (Programmers: when was the last time you checked the return value
Y2K38
from printf( ) or malloc()?) When one of the time_t support functions fails, the failure might
not even be detected by the program calling it, and more often than not this means the
# Set the Time Zone to GMT (Greenwich Mean Time) for date calculations.
print ctime($clock);
Possibility 1:
Y2K38
There is one major aspect of the physical world over which we have no control;
namely TIME. Since this is true, time is usually considered to be the independent variable in
most computer applications, and all other variable quantities are studied and measured with
respect to it. Some familiar examples of physical phenomena that are measured with
If we desire to use a computer to control some quantity that varies with time, the
computer must produce output control signals that also vary in accordance with the time
scale of the physical world. This is called “real time “applications. In order to illustrate this
concept, let us consider the case of a navigational control computer. Within the computer,
calculation of distance traveled and present position depends upon instantaneous values of
velocity and direction. Both of these are time varying quantities in the external, real
physical world. Any corrections in speed or azimuth that are made by the
computer in order to compensate for drift must be made on a real time basis.
Previously for convenience when solving problems with computers, liberal use was made of
time-scale factors. The applications of the real-time computation are almost unlimited in
number. Some of these applications, such as gun fire control, automatic navigation, missile
guidance, and machine control etc…..With the advent of the space age, the utilization of
real time computers for aiding navigation in outer space has become essential, since a
human pilot could not possibly solve the complex problems of guidance and control in time
to make the appropriate trajectory corrections. Speeded-up hybrid techniques can be
applied directly to the problems of real-time computation and control. The ever-increasing
demand for faster aircraft and missiles has placed such stringent requirements upon the
computers and techniques in use today.
6. WHAT ABOUT MAKING TIME_T UNSIGNED IN 32-BIT
SOFTWARE?
One of the quick-fixes that have been suggested for existing 32- bit software
unsigned integer doesn't have to waste one of its bits to store the plus/minus signed
for the number it represents. This doubles the range of numbers it can store.