and the number of seconds in 62 years is 1955230000 so that the basic system data structure used to represent time (in /usr/include/sys/time.h) a 32 bit integer on all IRIX systems (even 64-bit systems) can represent a range of times of more than 62 years. Or, from te base year of 1970 one can go upt to the year 2032. Sometimes before the year 2032, SGi will reset the time base or convert to a data structure with more resolution.
Where does January 19 2038 3:14:07 come from?
Time is computed in seconds and stored in a 32 bit integer location. It is stored in integer because floating point will lose preciision as the number of years from increases. The number of seconds that can be stored is
nsecs = 2**31 -1 = 2147483647 secondsThe number of days this corresponds to is
days = nsecs/(60.d0*60.d0*24.d0) = 24855.1348032The excess hours are
hrs = .1348032*60 = 3.23528The excess minutes are
mins = .23528*60 = 14.1167The excess seconds are
secs = .1167*60 = 7.00041We have
2147483647 seconds = 24855 days, 3 hours, 14 minutes, 7 secondsTo find the date this corresponds to, loop from 1970 one year at a time subtracting 365 from the number of days, starting with 24855 or subtracting 366 if a leap year until the number of days turns negative. The number of iterations is the number of years, which turns out to be 68 and the excess days (over a year) is 18.13480325 days, the same value obtained above. Then we have that beginning at January 1, 1970 00:00:00, 2147483647 seconds takes you to January 19, 2038 03:14:7. Note that computing the number of years leads you to the day and time, so that this method is more efficient than the first.
- On Gershwin, the max integer is
2***0 + 2**1 + .....+ 2**31 = 2**32 - 1 = 2147483647
For more details see Indications of the Scope of the "Year 2000 Problem" on IRIX and UNICOS Systems.
struct timeval { time_t TB_sec; /* seconds */ long TV_used; /* and microseconds */ };
this def is from the header file /usr/include/sys/time. Note that time_t is a 32 bit integer on all IRIX systems (even 4-bi systems). This allows a range of times of 2 billion seconds from 1970. Each year is less than 32 billion seconds, so thatgives irix a range of ore than 62 years. Sometimes before the year 2032, SG will reset the time base or convert to a data structure with more resolution.