Slashdot Mirror


The Quickly Descending Unix Timestamp

Teach writes: "If my calculations are correct, on Thursday, April 19, 2001, at 04:25:21 UTC (00:25:21 EDT and late Wednesday at 21:25:21 PDT), the UNIX clock will read 987654321, which is pretty cool. This will be the first of two such "significant" events in 2001, the second being 01:46:39 UTC on 2001-09-09, when the clock will read 999999999 (and then of course "roll over" to 1000000000 one second later). Use the Time Zone Converter to help you figure out when this will occur in your area, or read up on other critical dates (such as when the 32-bit signed UNIX clock overflows in 2038)."

15 of 272 comments (clear)

  1. Are we coming up to an "S1B" bug? by Speare · · Score: 5

    Not many programs are gonna care how many digits are in a timestamp, but I bet some do try to format stuff assuming a less-than-one-billion-seconds-since-epoch time.

    Review your code?

    --
    [ .sig file not found ]
    1. Re:Are we coming up to an "S1B" bug? by abelsson · · Score: 4
      What moron moderated this flamebait?

      In fact, the poster is absolutly correct- Kmail did have exactly the kind of bug he's talking about - a one billion second buffer overrun bug. They issued a patch a few weeks ago.

      read about it here

      -henrik

    2. Re:Are we coming up to an "S1B" bug? by edhall · · Score: 5

      There is another 999999999 rollover problem. Some admin scripts (in BASH, PERL, etc.) assume that the decimal timestamp can be compared as an ASCII string. Unfortunately, 999999999 > 1000000000 in this case, which can cause such scripts to break in subtle or overt ways. For example, if TS1=999999999 and TS2=1000000000, the BASH statement:

      if [ $TS1 ">" $TS2 ]; then

      will evaluate as true.

      -Ed
  2. It's like an odometer by Slashdot+Cruiser · · Score: 5

    Fortunately, the Unix internal clock works in a manner very similar to the odometer on the Slashdot Cruiser. When you go to trade in your Unix system and step up to Windows, all you have to do is crack open the little block box inside your machine and roll it back several hundred thousand milliseconds.

    Nobody will know the difference save the occasional hidden-camera "consumer protection" reporterette. These people seem to have nothing better to do than spy on semi-honest computer salesman and publicly humiliate them for the crime of trying to feed their families. We could talk about the silliness of having to disclose whether or not your computer had its case straightened after a minor plastic-bender, but that would be a whole nother post....

    --

    Got a full tank of hot grits and a penis bird in the glove box.
  3. Using Perl.... by ajs · · Score: 5

    So, you have a UNIX timestamp you want to check out? Try Perl on the command-line:

    perl -MPOSIX -le 'print ctime(999999999)'
    perl -MPOSIX -le 'print ctime(987654321)'

    For another timezone, you can just set the TZ environment variable. On the command-line, or in the code:

    perl -MPOSIX -le '$ENV{TZ}="CST";print ctime(200)'

    Actually, because there are historical reasons for ctime supplying a newline, you can drop the "l" from "-le".

  4. Java time by andyh1978 · · Score: 5
    3E08 approx. - Java time fails - (64-bit signed milliseconds from 1970) - A.D. 292,278,994-08-17 Sun 07:12:55.808 GMT
    I knew Java was over-engineered, but this is taking things a bit far. :-p (and possibly being a little optimistic on the popularity of Java over the next 292 million years)
  5. Look, ma, no modules! by J'raxis · · Score: 5
    No module needed:
    perl -le 'print scalar gmtime(999999999)'

    And of course localtime() for your own timezone.

    ...I am the Raxis.

  6. But tell us... by Black+Parrot · · Score: 3

    > Thursday, April 19, 2001 ... the UNIX clock will read 987654321, which is pretty cool.

    OK, but when are we going to get the Slashdot User #987654321 throw-down troll account?

    We went from 100000 to 400000 so fast that I wouldn't expect it to take too much longer.

    --

    --
    Sheesh, evil *and* a jerk. -- Jade
  7. Also..... by ZanshinWedge · · Score: 5

    In case you were wondering, unixtime 123456789 occured on
    Thu Nov 29 13:33:09 1973
    (please do not waste mod points on this post, thanks)

  8. Re:Hmm.....nice wording by andyh1978 · · Score: 3

    Then we call it 'Knowledge Base article Q216641' (after quickly working out how long 2**32 milliseconds is)...

    Unfortunately you don't have until 2038 in this case.

  9. "One Billion Seconds of Unix" by John+Whitley · · Score: 4

    I dunno, but that sounds like one of the best excuses for a geek party I've ever heard.

    Heck, that might even be a big enough party to be called a "Conference." ;-)

    1. Re:"One Billion Seconds of Unix" by isomeme · · Score: 5
      I dunno, but that sounds like one of the best excuses for a geek party I've ever heard.

      Predicted party song:

      One billion seconds are stored in time_t,
      One billion seconds of time;
      Decrement, post an event,
      Nine hundred ninety-nine million, nine hundred ninety-nine thousand, nine hundred ninety-nine seconds are stored in time_t...

      --

      --
      When all you have is a hammer, everything looks like a skull.
    2. Re:"One Billion Seconds of Unix" by Dwonis · · Score: 3
      One billion seconds are stored in time_t,

      time_t is a type, not a variable. You can't store a value in time_t. 8-)
      ------

  10. Watch it live... by felipeal · · Score: 3

    ... with the command:

    watch -n 1 date +%s

    or better yet:

    watch -n 1 'echo "The time is near: `date +%s`"'

  11. STOP, do not tell your friends about this issue by Spackler · · Score: 3

    I can't wait for the MSNBC story about this one.

    Redmond WA.
    Today Bill Gates announced that all *nix systems will halt with the September 9th coming of the S1B bug. MSNBC recommends that all *nix users switch to Windows XP before it is too late. Steve Balmer was reported to say how amazed he was that *nix could be so short sighted. XP was designed to be S1B compliant right from the start (after installing SP8 due sometime in September). All you Windows users will be kept safe from this, and should not consider going to any rogue operating systems at this time.