5-Digit Year Problem

I am a member of the Long Now Foundation and the Long Now Foundation uses 5-digit years (e.g. 2010 is 02010). 2010, unlike 2009, is a valid octal (base-8) number.

Many of the C-family programming languages have a 5-digit year problem.

Numbers that start with a zero are treated as octal numbers by the compiler. 02009 is not a valid octal number because nine is not a valid octal digit. 02010 is comprised of four valid octal digits.


/* int lastyear = 02009; // doesn't compile */
int thisyear = 02010; // compiles
cout << thisyear; // prints 1032

Leave a comment