Epoch win!

By Phil Plait | February 13, 2009 12:00 pm

Note: My apologies; this got briefly posted on the 12th by accident. I took it down and reposted it on the 13th, the correct day. Sorry!

Do you know Unix? If you do, then today at 18:31:30 (Eastern US) is an interesting time. If you have a Mac or Unix machine, type this into your terminal prompt:

perl -e ‘print scalar localtime(1234567890),”n”;’


I know, dorky. But then, whenever I see a digital clock reading "10:54", I always say "Crab Nebula time!".

If you thought you could outdork me, give up now.

CATEGORIZED UNDER: Cool stuff, Humor

Comments (67)

Links to this Post

  1. Lousy Canuck » Happy 1234567890! | February 13, 2009
  1. Barry

    It feels like only 35 years since we celebrated 123456789…

  2. Wow. There is nothing more to say. Unix time I can handle. But Crab Nebula time just blew my mind.

    All hail our dorky overlord!

  3. Eric Wallace

    But then, whenever I see a digital clock reading “10:54”, I always say “Crab Nebula time!”.

    Wow, that took me a while. I was trying to figure out why Crab time wasn’t something like 5:34:22. Maybe I’ll designate that Crab Pulsar time.

  4. Ryan

    I feel really dumb now. I run a website and have lots of logs with Unix timestamps in them and noticed the 1234 part recently. But I failed to realize this was happening.

  5. mocular

    Uh, I must have entered a time warp….I get

    Fri Feb 13 16:31:30 2009

    when it’s only Thursday here along the Colorado Front Range. I suppose BA runs in Universal Time?

  6. Ryan

    Um, so I did run this on my Linux machine and it says this happens tomorrow.

    More like Epoch FAIL

  7. James McCann

    I guess that’s cool, but next time you post a shell command please use proper ASCII quotes.


    Oh and happy Darwin Day.

  8. Hmm, I thought unix sang falsetto and a mac made you fat. Why do they need a script to get the time?

  9. Eric Wallace

    But then, whenever I see a digital clock reading “10:54”, I always say “Crab Nebula time!”.

    Wow, that took me a while. I kept wondering why it wasn’t something like 5:34:22. Maybe I’ll just designate that as Crab Pulsar time.

    And I also get Friday with the Unix time thing. And interestingly, a simple copy/paste of your command gave me a syntax error, but typing it manually was fine. It looks like the quotes got copied with some formatting that caused the shell to not recognize them (maybe some other unicode character, or something along those lines?)

    And sorry if the first part of this is a double comment.

  10. I finally got 10:54. But I think my favorite has to be my university mail code… You can reach me at 1987A!

  11. Yes. I was all confused about this last night, and then it disappeared before I could say anything.

    Premature epostulation puts a little tarnish on your dorkly crown!

  12. becky'sthoughts

    Thank you for that. We used to call 10:04, comb jelly time. My nerditude knows no bounds.

  13. mike

    Cute, but I really prefer palindromes.

    perl -e ‘print scalar localtime(1234554321);’

    That’s in 25 minutes. Nice excuse for lunch (PST).

    And using the year as a time? Pshaw. Now, if you were a REAL geek, you would have an alarm clock in LST. How else will you know when your favorite star is on the meridian?

    Might make for fun work schedules. Almost as fun as those poor JPL saps who have to work on Mars sols.

  14. Brian

    Shorter command to do the same thing: perl -le 'print~~localtime 1234567890'

    (James McCann: don’t blame Phil; it’s actually a feature of WordPress to automatically replace ASCII single-quotes with the Unicode variants. Very annoying when dealing with code.)

    Did anyone else here attend a gigasecond party back in 2001 when the Epoch hit 1000000000? That was convenient because it fell on a Saturday. I have friends who wanted to throw a 1234567890 party, but everyone’s at work today.

  15. Wayne

    Ah yes, I remember in high school watching the clock turn 01:23:45 on the 6th of July, ’89. My nerd cred goes way back. Also, a couple of minutes before I saw this post I was telling a student how I celebrated my billionth second birthday as a post-doc. He just came back and said he would be a billion seconds old in 2020. I’m getting old.

  16. Bill

    I’ve always been a fan of “binary days” myself Jan 1,10,11; Oct 1,10,11, Nov 1,10,11. After 11/11/11, I’ll have no more in my lifetime to look forward to. :(

  17. Steve

    I’d missed my billionth birthsecond (10^9), so I celebrated my birth-gibisecond. I was 2^30 seconds old. I figured noting the clock rolling over in binary was a decent second best for a computer science guy.

    If you’re on certain unixes “date -r 1073741824” is shorter.

  18. uknesvuinng
  19. Hoonser

    I got ‘Invalid parameter’ on mine. I just upgraded the ram on my macbook as well. Jeesh.

  20. Caleb

    >> If you thought you could outdork me, give up now.

    http://www.1234567890day.com has done just that by organizing count-down parties around the world.

  21. Guy Mac

    Almost as cool as entering this URL
    javascript:alert(new Date(1234567890*1e3));

  22. Caleb

    Try this for some more perl unix time fun:

    perl -e ‘print scalar localtime(2147483647),”n”;’

    Note the time.

    perl -e ‘print scalar localtime(2147483648),”n”;’

    Now check again.

  23. JB

    whenever I hear the quote from Hamlet..
    “to be, or not to be”
    I just think “FF”

    but thats just me

  24. Thought for sure I’d scoop you on at least this one. I can’t even hold a candle to Phil’s geekiness while fighting on my own turf!

  25. When it’s 4:04 I think, not found.

    When it’s 4:44 I think of the train in the Jerry Garcia Band version of Mystery Train.

  26. MadScientist

    Yeah, and my new bike just ticked past 11111.1km; I probably missed out on 12345.6 because I don’t stare at the odometer all the time.

    Anyway, for me that perl expression evaluates to:
    Sat Feb 14 10:31:30 2009 AEST
    Fri Feb 13 23:31:30 2009 UTC

    @mocular: The Colorado ranges are in the WEST. BA stated he’s using a time zone in the EAST. That’s a few hours difference.

    The UNIX time that has me spooked is 2147483647. People involved with programming language and POSIX standards don’t seem to have agreed how to represent time after that date (Tue Jan 19 03:14:07 2038 UTC) or at the very least I don’t see a uniform scheme being presented in operating systems and programming languages. Fortunately all my data with times are stored in a database and will not be affected by the UNIX time problem. On the bad side, all the processing software uses the 32-bit UNIX time representation. I don’t expect my instruments to be used for that long so I’m not worried about the time representation on them.

  27. MadScientist


    ] export TZ=utc
    ] perl -e ‘print scalar localtime(2147483647),”n”;’
    Tue Jan 19 03:14:07 2038
    ] perl -e ‘print scalar localtime(2147483648),”n”;’
    Tue Jan 19 03:14:08 2038

    So – what were *you* expecting? :P~
    I guess perl must use its own time conversion functions …

  28. mike

    MadScientist, you don’t have a POSIX system.

    Unix date 2147483648 is NOT in 2038. That’s 68 years and 18+ days BEFORE the Epoch. One number lower is 68 years and 18+ days after. The Epoch (localtime(0)) is
    Jan. 1, 1970.

    I have a compliant (Linux/Debian) system. I get Fri Dec 13 12:45:52 1901 (PST). This is the right answer.

  29. Caleb


    It could be that a later version of perl fixes this. On a few 32-bit systems, mine overflows back to 1901. Haven’t tried it on 64-bit systems.

  30. Okay. I don’t understand UNIX or Perl, and I don’t use the Mac Terminal, but when I copy and paste the various above command lines I keep getting the following error message: Badly placed ()’s.

    What is it supposed to do and why is it cool?


  31. lagomorph

    Not that OS-X is real UNIX but don’t you Mac guys have date -r?
    %date -r 1234567890
    Fri Feb 13 18:31:30 EST 2009

  32. Jeroen


    It has nothing to do with Posix.
    time_t is a type defined in ANSI/ISO C
    They conveniently didn’t define whether it should be signed (overflowing in 2038) or unsigned (overflowing 68 years later).
    On some platforms it is signed, on others unsigned, both are correct.

    Posix doesn’t redefine this type. So on a Posix system it can be either, and thus to be sure you should never assume it is safe to go beyond 2038.
    Most systems are being ‘fixed’ to use an unsigned value. Internally most systems already use larger (ie 64bit) values which will overflow about the same time the Sun goes kaboom.

  33. Abbie

    I seem to be in the unfortunate window of being nerdy enough to use linux but not nerdy enough to understand this.

  34. Jeroen


    Btw, the ANSI/ISO C spec also doesn’t specify how many bits time_t should be…
    Nobody is stupid enough to make it 16bit.
    32 bits is just a often used implementation (and since programmers are idiots often working on assumptions instead of facts you can’t change this easily).
    Defining time_t to be larger than 32bit is also a valid solution. (Except that it also breaks a lot of assumptions because programmers are idiots)

    For those offended: I am a programmer….

  35. lagomorph: Actually, it is a real Unix as of 10.5 on the Intels. (Linux, oddly, technically isn’t.)

    Abbie: it’s just that we’re about to hit second number 1234567890 after the start of the Unix system clocks. It’s like watching an odometer turn over: cool, but that’s all.

  36. TheBlackCat

    @ mike: that assumes a 32-bit system. On a 64-bit system the time variable is also 64 bits so there is no rollover.

  37. The 1234567890 moment has its own website (click my nick for link)

  38. lagomorph

    John Weiss: Well, it’s _based_ on FreeBSD but it’s been modified a lot. I’m a snob. :)

    And I wasn’t referring to Linux but OpenBSD. I haven’t used Linux in almost 10 years.

  39. lagomorph: It doesn’t matter how snobbish you wish to be, OS X meets the Unix 03 standards and is therefore a true Unix :-) . No BSD has ever been fully compliant with the standards, as far as I know. Not that it matters or really affects how good the systems are, but to the extent that names matter, OS X is definitely Unix.

    That said, I wish they’d fix the cut and paste behavior in the bloody Xterm windows…

  40. Er, and to be clear: that post wasn’t mean to be snarky. Re-reading it, I worry that it might sound that way. Frankly, I’m not really concerned about this issue. I’m just a Stickler for Accuracy. (Also, I sit on the Axiom Appeals Board.)

  41. Cusp

    >> If you have a Mac or Unix machine

    Modern macs are unix (for small values of unix)

  42. lagomorph

    No worries. I guess it comes down to the definition of UNIX. I’m fairly minimalist. To me, OpenBSD simply shares my goals. They adhere to standards when they make sense. They put files where they belong. They care about quality and correctness and tight code. I associate this with true, traditional UNIX. OS-X is not typically used in any way that would feel like UNIX in a traditional sense. When you probe under the hood, in my opinion, the part that is UNIX-like is a mess. It’s UNIX with a whole bunch of stuff grafted on and that “stuff” is pretty much what most users are going to interact with. It can look pretty slick on the outside though.

  43. Timothy from Boulder

    The Google logo this afternoon commemorates nerddom.

  44. OK, now I’m confused about the “comb jelly time” comment.

  45. Oh. Just sounded it out. Never mind.

  46. Must make it to my Linux box before midnight.

  47. C. ALan Zoppa

    Phil, FYI—

    date +%s

    will do the trick

  48. Extra dorky, pi time:

    date -r 31415926535
    Thu 25 Oct 2012 19:57:43 EST

  49. date -u will output in UTC time too.

  50. Freespace? Shouldn’t pi-time be in like 60 years? It’s taken nearly 30 to get to 1.2×10^10 seconds, shouldn’t it take nearly twice that to cover another 2×10^10?

    (Also, you have 11 digits, there. That’ll be… 1000 years?)

  51. Ah, good pick up. I think my poor 32bit processor overflowed… the 11 digit pi I used is ~31x larger than the largest unsigned 32bit int can hold…

    So some one on a 64bit system can try it and let us know ūüėõ

  52. blf

    Using GNU date(1), date –date=@1234567890 will also print the time; add –utc if you want it in UTC; or export an appropriate TZ. No reason to use perl(1) at all.

    For those of you arguing about 32-bitness, whether or not time_t is unsigned, etc., the Rationale in the original (IEEE) POSIX.1-1988 standard contained a fairly lengthy discussion of the entire subject.

  53. Perl Guy

    It should read:

    perl -e ‘print scalar localtime(1234567890) . “n”;’

    Replace the , with a . and change the open/close single quotes with apostrophes.

    And DAMN Phil, you should have left it in on thursday. I missed it on Friday.

  54. James McCann

    Replacing the characters you typed with different characters – with features like that who needs bugs?

    gawk — ‘BEGIN { print strftime(“%c”, ARGV[1]) }’ 1234567890

    gives the inverse of date +%s

  55. MadScientist


    I don’t know why you say my system isn’t POSIX compliant (I haven’t checked the latest POSIX spec or proposals).


    64 bit could be the problem; I tried using GNU ‘date’ as blf suggested and I still get the naively expected time rather than the time warp. I’ve got a ‘pure’ 64-bit system on an AMD Opteron. So is it my kernel, the GNU libraries, or both. Now I don’t even know if it’s just Perl or something else in my system. Oh well, it’s not something I need to worry about at the moment. :)

  56. Don’t forget the 17:01, Trek Hour.

  57. ProofByInduction

    “If you thought you could outdork me, give up now.”

    Phil, most of the above entries leave you in the dust as to dorkiness….:-)

  58. Kid Cool

    I surprised at all the geeks here not mentioning 11/19/1999 being the last all odd number date until 11/11/3111. Maybe 01/01/3111, but do the 0’s count?

    How about 02/02/2000 the first all even number date since 8/28/888

  59. TheBlackCat

    @ Kid: Bah, geeks don’t car about odd numbers. Odd an even are simply a result of our arbitrary obsession with the number 2. If we had trilateral symmetry it would probably be looking for numbers that are divisible by 3. Real geeks are waiting until 2/2/2011, the next all-prime date.

  60. I get the Unix time gag. I’m not geek enough to have run the math and remembered it. I didn’t feel too bad about that… but the Crab reference got me…

    10:54 for the Crab? I had to look up the Crab.

    Star Chart gave me:
    NGC 1952 / M1 / The Crab Nebula – RA 05h 34m 31.97s / Dec. +22¬į 00‚Ä≤ 52.1‚Ä≥…

    Then I looked it up in Wiki….

    Oh! That’s when it went KerPow (well, the year was 1054… I don’t know what time of day…)

    I feel bad for not getting that without looking it up.


  61. BethK

    Low tech geeks remember that March 14 is pi day with 1:59 adding more precision and then 26 seconds for even more. Aside: I just learned that my 13yo son knows pi to 30 digits.

    And my 15yo daughter already knew about the 1234567890 date thing.

    Where did I go right in raising them?

  62. mike

    I have a mac, I put that into the terminal and got a syntax error, wtf is up with that?

  63. JB

    Epoch? I was hoping for amusing at the very least. Dorky? OK you got me! I’ll see if I can cook up something more amusing. I’m guessing you are only in your twenties. I’m in my fifties…, all I have to do is dust off some of my time tested jokes.

    Maybe say something in programming. I’ll make it easy, I’ll use Cobol 77. I really appreciate the nomination, however, it seems that there are more prospective candidates on your end. I’m here by myself. I need reinforcements.

    I’ll keep an eye on you to see how you perform online. Oh, thanks for the compliment.



Discover's Newsletter

Sign up to get the latest science news delivered weekly right to your inbox!


See More

Collapse bottom bar