The Daily Parker

Politics, Weather, Photography, and the Dog

1.5 Gs

As of just a few moments ago, I passed 1.5 billion seconds old.

Yes, this is a thing most people don't really think about, but as someone who works in software, this actually has some significance—and another Y2K problem that will occur just a few months before I get to 2.0 Gigaseconds (Gs) in 2038.

The problem is a thing called the Unix epoch. Computers can only count as high as they have bits to count. Unix computers, which include Macs and most of the infrastructure of the Internet, count time in seconds from 1 January 1970 00:00 UTC, which was (at the moment I'm typing this) 1,521,383,994 seconds ago.

Everyone knows computers can count to awesomely huge numbers. But you need to give them enough bits to do that. Unix time is measured by a 32-bit number, which can count up to 232-1, or 4,294,967,295 (in binary, a 32-item string of 1s), which is enough seconds to count just over 136 years.

But you sometimes want to measure things that happened in the past, so Unix time takes the first bit of the 32-bit number and makes it a sign. If the first bit is 0, the time is in the present. If it's 1, the time is the number of seconds before the beginning of the epoch. So this cuts the measurable period in half, to 68 years. Specifically, Unix time rolls over at 3:14:08 on 19 January 2038.

The fix is simply to use a bigger number. Today, 64-bit numbers are no big deal, and they give you 263-1 (9,223,372,036,854,775,807) seconds to work with in either direction. That's roughly 292 billion years, which is sufficient to measure most human-scale activities.

So, knowing all this, and knowing that I was born in the first year of the Unix epoch, it wasn't difficult to figure out my "epoch" birth moment at 9:12 CDT this morning.

But there's a catch. As I mentioned, computers count by 2s, not by 10s, so this entire post is a lie. I'm not 1.5 Gs old; I'm just over 1,500,000,000 seconds old. 1.5 x 230 (i.e., 1.5 giga anything) is 1,610,612,736, so I won't be 1.5 Gs old until Unix moment 1,631,995,056, which will be 18 September 2021 at 19:57:36 UTC.

So check back in three and a half years. I'm sure I'll have another post about this nonsense then.

(For those of you keeping score at home, I was 1.0 Gs old on 13 September 2004 at 20:09:04 CDT, during a lull in blogging. Else I'm sure I would have mentioned this then.)

Comments (1) -

  • David Harper

    3/18/2018 4:14:22 PM +00:00 |

    Happy 1.5 Gs!  I'm currently between my 1.5Gs and 2.0Gs milestones, but a quick calculation reveals that I shall reach 20,000 days in a couple of months.  I think that calls for a celebration lunch at my favourite pub.

    Apropos methods of measuring time over long spans, astronomers long ago adopted the Julian Day Number system, which represents any date and time as a floating-point count of days from 1 January 4713 BCE.  Provided that you use double-precision, this is good enough to yield seconds-level precision over a time pan of plus or minus a couple million years.

Comments are closed