The YAK problem

22 July, 2008 - Post a comment - Permalink

I present to you the solution for the YAK problem. What's the YAK problem you ask? Why, it's the year 10,000 problem of course. Think about it: Today we use the format YYYY (2008) format. But what will we do when the year 10,000 rolls around the corner... in 8,000 years.

Don't worry, these guys have taken care of it:

   The most common fix for the Y2K problem has been to switch to 4-digit
years. This fix covers roughly the next 8,000 years (until the year
9999) by which time, everyone seems convinced that all current
programs will have been retired. This is exactly the faulty logic
and lazy programming practice that led to the current Y2K problem!
Programmers and designers always assume that their code will
eventually disappear, but history suggests that code and programs are
often used well past their intended circumstances.
3.1 Years 1 - 9999

The current 4-digit year syntax covers all years from 1000 - 9999.
These years are represented as 4 decimal digits. Leading 0's MUST be
added to the years before 1000 to bring the year to 4 digits. Files
containing legacy pre-Y1K [Mike] dates will have to be converted.

3.2 Years 10,000 through 99,999

Four digits are not sufficient to represent dates beyond the year
9999. So, all years from 10,000 - 99,999 are represented by 5 digits
preceded by the letter 'A'. So, 10,000 becomes "A10000" and 99,999
becomes "A99999". Since 'A' follows '9' in the ASCII ordering, all
dates with 5-digit years will follow all dates with 4-digit years
(for example, "A10000" will sort after "9999"). This gives us the
sort and comparison behaviour we want.

3.3 Years 100,000 up to 10 ** 30

By a simple generalization of 3.2, 6-digit years are preceded by the
letter 'B', 7-digit years by 'C', etc. Using just the 26 upper-case
ASCII characters, we can cover all years up to 10**30 (the last year
representable is "Z999999999999999999999999999999"). Again, since
the ASCII characters are sorted alphabetically, all dates sort
appropriately.

3.4 Years 10 ** 30 and beyond (Y10**30)

As discussed in 2.4.1, the end of the universe is predicted to occur
well before the year 10 ** 30. However, if there is one single
lesson to be learned from the current Y2K problems, it is that
specifications and conventions have a way of out living their
expected environment. Therefore we feel it is imperative to
completely solve the date representation problem once and for all.

Click here to read more about this fascinating subject.

Comments

No comments posted yet...

Post your comment

Feel free to share your opinion.

Name: Email: Website: Comment: