The beginning of time, at least as far as your computer's internal clock knows.
Time is measured in seconds since the epoch. For Unix systems (and I think Windows also) that's January 1st, 1970, 00:00:00 GMT.
Because time, like any computer value, is stored in a finite space, the apocalypse comes for 32 bit Unix on Janary 18th, 2038. That's when 32 bits overflows, and magically it will be January 1970 once again.
By then, of course, 64 bit systems will be in place, and Linux will have made Windows something we'll tell our disbelieving grandchildren about.
I'll be a month short of 90 years old when that day comes, and expect to be still babbling about Unix and Linux systems, though I hope Microsoft operating systems are gone by then.
The reason time is stored as offset seconds rather than a more complex, less limited format (like what we humans use: Sun Sep 21 12:18:48 GMT 2003), is that seconds are easier for programs to deal with. If you have today's date in seconds since the epoch, calculating tomorrow is simply a matter of adding (24 * 60 * 60 ).
Seconds since the epoch is exactly what is returned by the time() system call and the Perl function of the same name.
Got something to add? Send me email.
More Articles by Tony Lawrence © 2011-07-04 Tony Lawrence