y2k + 38 (and change)

Did you know? In a mere 31 years, we are facing our next Y2K.

UNIX machines, the POSIX standard and many implementations of the standard C library track system time as a count of the number of seconds since midnight of January 1, 1970. That moment in time is referred to as the Unix Epoch. The standard data structure used to store time is called time_t and is most often (if not always) represented by a 32-bit integer value.

The rest is simple math. (Make sure you account for leap years but you don’t have to worry about leap seconds.) But the end result is that at 3:14:07 (24-hour time) on January 18, 2038 time as we know it will be reset.

The problem isn’t being ignored but when you consider we have 31 years it’s probably not a priority. (“We work better under pressure,” said the collective world.) As system APIs evolve, the way we store time will evolve as well. Google unix epoch and you will find a number of pages dedicated to solving the problem – plus random geek shwag as well. A simple solution would be to change time_t to either be unsigned, doubling our breathing room but resulting in the ability to find a time before the Unix Epoch, or moving to a 64-bit value, which adds about 214 billion years.

Some systems have available a 64-bit version of time or provide APIs that insulate time users from needing to know the actual tick count. Similar to Y2K, applications that were developed to take in account the next rollover will be fine (i.e., those that use newer APIs or have built in accommodation). The applications that will suffer will be those that didn’t have the foresight.

Are we going to be placed on alert as in Y2K? Probably not. Some applications have a long life but a lot will change in the world of computing between now and then and they will need to evolve. Some may argue we are thickheaded when it comes to learning from our own history. Time will tell. If you’re developing time-sensitive applications, take a moment to reflect on how sensitive your design is to the roll-over and take the easy precautions now.

Also, someone may want to get Prince on the horn and have him start working on his follow up to 1999. “Tonight we’re gonna party like its 3:14:06 on January 18, 2038″ doesn’t flow quite as well.
Then again, I’m not sure I want to know exactly what funk he’d be bringing to the table at age 79.

No comments:

Post a Comment