The Time is 1234567890

Millions of computers around the world know this instant as 1234567890.

Unix-based systems store time as the number of seconds elapsed since January 1, 1970.  This is called the Unix Epoch Date.  Do the math, and at 23:31:30 UTC today that works out to 1,234,567,890 seconds.  Pretty neat!

Of course, there’s danger lurking here: generally, we use 32-bit signed integers to store the number of seconds.  A 32-bit signed integer can only store numbers up to 2,147,483,647 or so.  Do the math again, and you’ll arrive at another neat date: January 19, 2038.  On this day, shortly after 3:14 AM UTC (conspiracy theorists take note: why is this Pi?), the world ends.  Planes drop from the sky, bank machines spit out cash non-stop, and nuclear bombs detonate, just like they did at midnight on January 1st, 2000.  Awesome!

January 1, 1970 isn’t just the Epoch Date for UNIX.  A few other trivial systems use this date, as well.  You may have heard of some of them:

  • Linux
  • Mac OS X
  • Java / JavaScript
  • PHP

Man, oh man, will that a good day to be a Windows guy.  Of course, exactly ten years later DOS, FAT16, FAT32, and OS/2 all explode.  Hopefully by then we’ll all be using managed code: .NET bases dates around January 1, 1.  That’s 1 AD.  Presumably, they have this 32-bit unsigned integer problem sorted out.

No comments:

Post a Comment

Copyright © 2010 Paul Guenette and Matthew Sleno.