Raise a Glass — Time(2) Turns 40 Tonight
ddt writes "Raise your glasses of champagne in a toast at midnight. The time(2) system call turns 40 tonight, and is now officially 'over the hill.' It's been dutifully keeping track of time for clueful operating systems since January 1, 1970." And speaking of time, if you don't have a *nix system handy, or just want a second opinion, an anonymous reader points out this handy way to check just how far it is after local midnight in Unix time. Updated 10:03 GMT by timothy: The Unix-time-in-a-browser link has been replaced by a Rick Astley video; you have been warned.
There is a rickroll in article. Beware to click!
You moved your mouse. Please restart Windows for changes to take effect.
That second link is a Rick Roll.
Did you even check it?
because unix was invented in 1970?
It's 12:21am, Jan 1, 2010 here and I got rickrolleded. I set my clock back a day, and got a white screen with a countdown.
time_t is signed.
Epoch starts at January 1st, 1970, but the system call itself was not around in 1970.
The cake is a pie
That's output from the 'ddate'—Discordian date—program.
Anyone else notice the top of the hill is 1337?
Nope, the maximum value for 32-bit time_t is 2147483647. Increment that by 1, and the time_t value becomes -2147483648.
Although time_t is a 32-bit value, the 1st bit is the sign bit.
Jan 18 21:14:07, 2038
For 64-bit time_t it should be 9223372036854775807. But I don't believe the standard time functions can handle this value...
While it may be a perfectly valid 64-bit time_t value, if gmtime/localtime/strftime/ctime don't work with the maximum value, it's not a usable value, really
Indeed.
Some binary blobs do require the use of a signed integer for calculating differences in time which is much of the apparent hesitancy to convert to a 32 bit unsigned integer time system. More here.
Sigs are too short to say anything truly profound so read the above post instead.
Although time_t is a 32-bit value, the 1st bit is the sign bit.
The 1st bit is not a sign bit! Signed integer coding uses two's complement arithmetic.