Slashdot Mirror


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.

30 of 114 comments (clear)

  1. Give it 28 years by betterunixthanunix · · Score: 5, Insightful

    When time(2) turns 68, that will be newsworthy.

    --
    Palm trees and 8
    1. Re:Give it 28 years by yuhong · · Score: 2, Interesting

      Especially when the 32-bit time_t overflows. The good news is that most 64-bit OSes already uses a 64-bit time_t, but there still is the issue of truncation to 32-bit.

    2. Re:Give it 28 years by MichaelSmith · · Score: 2, Interesting

      Especially when the 32-bit time_t overflows. The good news is that most 64-bit OSes already uses a 64-bit time_t, but there still is the issue of truncation to 32-bit.

      Shouldn't the 32 bit time_t expire in 2106?

    3. Re:Give it 28 years by Anonymous Coward · · Score: 2, Informative

      time_t is signed.

    4. Re:Give it 28 years by Abcd1234 · · Score: 2, Interesting

      'fraid not. The 32-bit time_t is signed (I'm assuming so you can expression times less than the epoch, but that's just a guess). As such, it actually overflows in 2038.

    5. Re:Give it 28 years by mysidia · · Score: 5, Informative

      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

    6. Re:Give it 28 years by wizardforce · · Score: 3, Informative

      The 32-bit time_t is signed (I'm assuming so you can expression times less than the epoch, but that's just a guess)

      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.
  2. First Post! by therufus · · Score: 5, Informative

    There is a rickroll in article. Beware to click!

    --
    You moved your mouse. Please restart Windows for changes to take effect.
    1. Re:First Post! by Sporkinum · · Score: 2, Funny

      Beware what? Seeing in the new year with Rick Astley seems like a pretty good thing to me. Then again, I am easily amused!

      --
      "He's lost in a 'floyd hole"
  3. It's not April 1 yet by SpazmodeusG · · Score: 2, Informative

    That second link is a Rick Roll.
    Did you even check it?

    1. Re:It's not April 1 yet by jamesh · · Score: 5, Funny

      You should install the RickBlockPlus browser addon to prevent this sort of thing happening.

    2. Re:It's not April 1 yet by Anonymous Coward · · Score: 2, Funny

      Oh, you people. It's just an alternative to the usual UNIX epoch.

      time_rickroll(2) Unix Programmer's Manual time_rickroll(2)

      NAME
                time_rickroll - get time since 16 November, 1987.

      SYNOPSIS
                #include

                time_t time_rickroll(time_t *t);

      DESCRIPTION
                time_rickroll returns the time since the Astley Epoch (00:00:00 UTC, November 26, 1987) measured in seconds.

                If t is non-NULL, the returned value is also stored in the memory pointed to by t.

      RETURN VALUE
                On success, the value of time in seconds since the start of the Astley Epoch is returned. On error,
                ((time_t)-1) is returned, and errno is set appropriately.

      ERRORS
                EFAULT t points outside your accessible address space.

      NOTES
                See time(2) for limitations with regards to leap seconds and other matters of consistency. In addition, the exact timing
                of release of "Never Gonna Give You Up" on November 26, 1987 is assumed to be 00:00:00 UTC on that date, even though
                it is unlikely that a midnight release party was held. Some purists also believe that the correct Astley Epoch begins
                sometime in May 2007, however the possibility exists of
                earlier examples of rickrolling, but none can predate November 26, 1987, the Astley Epoch chosen here.

      POTENTIAL SIDE EFFECTS
                There have been scattered reports of a bug that affects video and sound output when this function is called.

      SEE ALSO
                date(1), time(2), time_duckroll(2)

  4. Unix epoch? by arnoldo.j.nunez · · Score: 3, Interesting

    Why was the epoch chosen to be 00:00:00 UTC on 1 January 1970?
    Why didn't we restart it at 2000 amidst the Y2K mess?

    1. Re:Unix epoch? by MichaelSmith · · Score: 5, Interesting

      Putting it in 1970 is a pain. VMS at least put their zero date in 1858, where it is less likely to conflict with real dates. If course, VMS had 64 put support from the word go. Rebasing time_t would have created a horrible mess. Better to start again with a proper date type.

    2. Re:Unix epoch? by schon · · Score: 5, Funny

      Why didn't we restart it at 2000 amidst the Y2K mess?

      You have a promising career in middle management ahead of you!

    3. Re:Unix epoch? by troll8901 · · Score: 2, Insightful

      No, no, middle management does all the work. Such a decision is usually done by top management.

  5. Damn you Slashdot! by nurhussein · · Score: 5, Funny

    Rickrolling is so 2009.

  6. Windows by Tablizer · · Score: 2, Funny

    The Windows clock starts the second Gates stiffed IBM out of the DOS market.

  7. Why is there a link to this guy's blog? by HockeyPuck · · Score: 2, Interesting

    The Unix time(2) system call is "over the hill" at 40 years old today. The time(2) system call has dutifully told us how many seconds have passed since January 1, 1970. I use the day as my "birthday" on public websites in tribute. Please raise a glass of champagne tonight with me in celebration!

    Why is there a link in the summary to some guy's blog which says exactly what I've pasted above? I mean really, just put the information in the summary without the link....

    1. Re:Why is there a link to this guy's blog? by PopeRatzo · · Score: 2, Insightful

      More important, why is the guy with the blog still wearing a face mullet, in 2010?

      And have you ever met an "independent game producer" with such a neatly trimmed beard?

      --
      You are welcome on my lawn.
  8. Only a rickroll after midnight by Xocet_00 · · Score: 4, Informative

    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.

  9. That's funny,... by Telecommando · · Score: 4, Funny

    My clock says today is Setting Orange, Day 73 of the Aftermath in the Year of Our Lady of Discord 3175.

    --
    Beta sux! Join the Slashcott! http://hardware.slashdot.org/comments.pl?sid=4760465&cid=46173047
    1. Re:That's funny,... by KTheorem · · Score: 2, Informative

      That's output from the 'ddate'—Discordian date—program.

  10. Flash? Seriously? by Anonymous Coward · · Score: 3, Insightful

    Just for showing the epoch time?

  11. This is not true by ucblockhead · · Score: 5, Informative

    Epoch starts at January 1st, 1970, but the system call itself was not around in 1970.

    --
    The cake is a pie
  12. Re:Problem with this by PopeRatzo · · Score: 4, Insightful

    I mean, c'mon, are we supposed to also be celebrating the 190th birthday of perl's localtime()?

    I don't know about you, but I'm ready to drink to that.

    My wife and I opened a bottle of champagne a few hours ago, and she's fallen asleep after two glasses, the lightweight. I had a double espresso with my pecan pie and now I'm ready to friggin' rawk!

    After I submit this, I'm gonna go show some Borderlands weaklings who's boss. Either that or finish the champagne and go watch the fireworks from my rooftop, naked. It's -2 degrees F outside though, so maybe I ought to pull out the thermal merkin first. I mean, subzero temperatures, nudity and high blood-alcohol level - what could possibly go wrong?

    --
    You are welcome on my lawn.
  13. Am I the only one? by BlueBoxSW.com · · Score: 2, Insightful

    Who is almost exactly as old as *nix time?

  14. Re:Over the hill? by MichaelSmith · · Score: 2, Insightful

    I reject your reality and substitute my own.

  15. Re:Over the hill? by multi+io · · Score: 5, Interesting
    Decimal jubilees are meaningless. time(2) has passed the top of the hill almost six years ago!

    $ TZ=GMT ruby -e '((0..29).map{|bit| 1<<bit} + (0..30).to_a.reverse.map{|bit| (1<<31) - (1<<bit)}).each{|t| puts "%031b %s" % [t, Time.at(t)]}'
    0000000000000000000000000000001 Thu Jan 01 00:00:01 +0000 1970
    0000000000000000000000000000010 Thu Jan 01 00:00:02 +0000 1970
    0000000000000000000000000000100 Thu Jan 01 00:00:04 +0000 1970
    0000000000000000000000000001000 Thu Jan 01 00:00:08 +0000 1970
    0000000000000000000000000010000 Thu Jan 01 00:00:16 +0000 1970
    0000000000000000000000000100000 Thu Jan 01 00:00:32 +0000 1970
    0000000000000000000000001000000 Thu Jan 01 00:01:04 +0000 1970
    0000000000000000000000010000000 Thu Jan 01 00:02:08 +0000 1970
    0000000000000000000000100000000 Thu Jan 01 00:04:16 +0000 1970
    0000000000000000000001000000000 Thu Jan 01 00:08:32 +0000 1970
    0000000000000000000010000000000 Thu Jan 01 00:17:04 +0000 1970
    0000000000000000000100000000000 Thu Jan 01 00:34:08 +0000 1970
    0000000000000000001000000000000 Thu Jan 01 01:08:16 +0000 1970
    0000000000000000010000000000000 Thu Jan 01 02:16:32 +0000 1970
    0000000000000000100000000000000 Thu Jan 01 04:33:04 +0000 1970
    0000000000000001000000000000000 Thu Jan 01 09:06:08 +0000 1970
    0000000000000010000000000000000 Thu Jan 01 18:12:16 +0000 1970
    0000000000000100000000000000000 Fri Jan 02 12:24:32 +0000 1970
    0000000000001000000000000000000 Sun Jan 04 00:49:04 +0000 1970
    0000000000010000000000000000000 Wed Jan 07 01:38:08 +0000 1970
    0000000000100000000000000000000 Tue Jan 13 03:16:16 +0000 1970
    0000000001000000000000000000000 Sun Jan 25 06:32:32 +0000 1970
    0000000010000000000000000000000 Wed Feb 18 13:05:04 +0000 1970
    0000000100000000000000000000000 Wed Apr 08 02:10:08 +0000 1970
    0000001000000000000000000000000 Tue Jul 14 04:20:16 +0000 1970
    0000010000000000000000000000000 Sun Jan 24 08:40:32 +0000 1971
    0000100000000000000000000000000 Wed Feb 16 17:21:04 +0000 1972
    0001000000000000000000000000000 Wed Apr 03 10:42:08 +0000 1974
    0010000000000000000000000000000 Tue Jul 04 21:24:16 +0000 1978
    0100000000000000000000000000000 Mon Jan 05 18:48:32 +0000 1987
    1000000000000000000000000000000 Sat Jan 10 13:37:04 +0000 2004
    1100000000000000000000000000000 Thu Jan 14 08:25:36 +0000 2021
    1110000000000000000000000000000 Wed Jul 18 05:49:52 +0000 2029
    1111000000000000000000000000000 Tue Oct 18 16:32:00 +0000 2033
    1111100000000000000000000000000 Tue Dec 04 09:53:04 +0000 2035
    1111110000000000000000000000000 Fri Dec 26 18:33:36 +0000 2036
    1111111000000000000000000000000 Wed Jul 08 22:53:52 +0000 2037
    1111111100000000000000000000000 Wed Oct 14 01:04:00 +0000 2037
    1111111110000000000000000000000 Tue Dec 01 14:09:04 +0000 2037
    1111111111000000000000000000000 Fri Dec 25 20:41:36 +0000 2037
    1111111111100000000000000000000 Wed Jan 06 23:57:52 +0000 2038
    1111111111110000000000000000000 Wed Jan 13 01:36:00 +0000 2038
    1111111111111000000000000000000 Sat Jan 16 02:25:04 +0000 2038
    1111111111111100000000000000000 Sun Jan 17 14:49:36 +0000 2038
    1111111111111110000000000000000 Mon Jan 18 09:01:52 +0000 2038
    1111111111111111000000000000000 Mon Jan 18 18:08:00 +0000 2038
    1111111111111111100000000000000 Mon Jan 18 22:41:04 +0000 2038
    1111111111111111110000000000000 Tue Jan 19 00:57:36 +0000 2038
    1111111111111111111000000000000 Tue Jan 19 02:05:52 +0000 2038
    1111111111111111111100000000000 Tue Jan 19 02:40:00 +0000 2038
    1111111111111111111110000000000 Tue Jan 19 02:57:04 +0000 2038
    1111111111111111111111000000000 Tue Jan 19 03:05:36 +0000 2038
    1111111111111111111111100000000 Tue Jan 19 03:09:52 +0000 2038
    1111111111111111111111110000000 Tue Jan 19 03:12:00 +0000 2038
    1111111111111111111111111000000 Tue Jan 19 03:13:04 +0000 2038
    1111111111111111111111111100000 Tue Jan 19 03:13:36 +0000 2038
    1111111111111111111111111110000 Tue Jan 19 03:13:52 +0000 2038
    1111111111111111111111111111000 Tue Jan 19 03:14:0

  16. Re:Over the hill? by wagnerrp · · Score: 2, Informative

    Anyone else notice the top of the hill is 1337?