The time is now…

Today the Unix time stamp hits 1234567890. Today, all Unix/Linux geeks around the world are writing scripts like this one:
import time
while time.time() < 1234567890.0:    time.sleep(0.25)
print "The time is",time.time(),"!"
Seriously. Gotta do it.

8 thoughts on “The time is now…”

  1. In hex, 1234567890 is 0x499602d2. Not very interesting I’m afraid. I think the correct script is
    #include <stdio.h>
    #include <stdlib.h>
    #include <time.h>

    struct timeval tv;
    main() {
      do {
        (void)usleep(250);
        (void)gettimeofday(&tv, NULL);
      } until (tv.tv_sec >= 0x49999999);

      printf("The time is 0x%x", tv.tv_sec);
    }

    And yes, in addition to being a geek, I’m old. 3000 years old, in fact. But my hair is still fabulous.

  2. But in hex, 0×49999999 doesn’t roll over to 0×50000000, it rolls over to 0×4999999A…
    Anyway, that script was old, old, old. I’ve moved way beyond that now. I laugh at the person I was back then — HAH! Here’s the current script:
    import time, os
    curtime = 0
    partytime = 1234567890.0

    while time.time() < partytime:   if time.time() - curtime > 1000.0:
        curtime = time.time()
        delta = partytime-curtime
        if delta < 60.0:       s = '%d seconds' % (round(delta))     elif delta < 3600.0:       s = '%d minutes' % (round(delta/60))     else:       h = int(delta/3600.0)       m = round((delta-h*3600.0)/60.0)       s = '%d hours and %d minutes' % (h,m)     print "The current time is %d. %s until The Time." % (round(curtime),s)   time.sleep(0.25)

    print "The Special Time has arrived! The time is %f!" % time.time()
    os.system('curl -u TipaDaKnife:xxxxx -d status="Rejoice, the Unix system time is now: %f." http://twitter.com/statuses/update.json' % time.time())

  3. Hey Tipa,
    I just wanted to let you know that I’ve linked to you from Bio Break, my general MMO blog. If you’d like to reciprocate linkage, I’d be grateful! (Just trying to get some readership going there.)
    Rock on,
    Syp
    biobreak.wordpress.com

Comments are closed.