The 2286 Bug

Unix timestamps represent time as seconds elapsed since January 1, 1970. The current-ish Unix timestamp as of this writing is 1453665679. On November 20, 2286, another digit will be added to this number as it reaches 10000000000. This could cause issues for some programs, specifically those programs that sort lexicographically on a string representation of this number. How many programs do this that will ever need to represent dates later than Nov 20, 2286? Who knows; it’s probably not very common.

A better-known and possibly more common bug will arise in 2038, when the Unix timestamp hits 2147483647, the maximum value that can be represented by a signed, 32-bit integer. This number also happens to be the 8th Mersenne prime, according to Wikipedia. Then there’s the maximum value that can be stored in an unsigned, 32-bit integer, 4294967295, which will be hit by Unix time on February 7, 2106.

Hopefully by the time these bugs strike, most computing platforms will be using 64-bit integers, which can safely represent Unix timestamps until long after the sun cooks Earth to a crisp.

But the 2286 bug is interesting because it doesn’t have anything to with overflow, which can be generally fixed. Lexicographic ordering of integers as been a source of bugs for a long time because data is messy and often formatted incorrectly. In the early 23rd century, I imagine Fortran programmers at banks will be gnashing their teeth over it.

Show your support

Clapping shows how much you appreciated Nathan Smith’s story.