This Technical Note explains how ProDOS year values range from zero to ninety-nine and represent the years 1940 through 2039.
The ProDOS date format uses sixteen bits: seven bits for the year, four for the month, and five for the day (see the ProDOS 8 Technical Reference Manual, page 71). Dates are represented in this format in the parameter blocks for ProDOS 8 MLI calls and in the directories of ProDOS volumes.
In seven bits, 128 different years could be represented, but the proper interpretation of those bits has never been defined clearly until now.
It's only nine years, folks, and then things get weird. Is that ProDOS year 100 or ProDOS year 0? How do you compare two file-modification dates so it keeps working correctly?
Before you dismiss questions like this, consider just how sure you are that nobody will be using your software in nine years, or whether those few dedicated weirdos are going to call you up on January 1, 2000 to complain. There will be plenty of computer-related problems in 2000, so write your applications right today.
These two possible interpretations were considered and then rejected in favor of The Definition below.
So, you are left with...
The following definition allows the same range of years that the Apple IIgs Control Panel CDA currently does:
Note: Apple II and Apple IIgs System Software does not currently reflect this definition.
To compare two dates, you need to adjust the years to allow for the wrap-around effect between 39 and 40. A simple approach is to add 100 to any year less than 40 before doing the comparison, thus comparing two values in the range 40 to 139.
CompareAB lda YearB cmp #40 bcs B_OK adc #100 ;carry is clear sta YearB B_OK lda YearA cmp #40 bcs A_OK adc #100 ;carry is clear sta YearA A_OK cmp YearB bcc A_is_earlier ...
This definition affects how the GS/OS ProDOS File System Translator works internally, but it does not affect GS/OS applications. A year value under GS/OS is always a byte offset from 1900, giving a possible range of 1900 to 2155, regardless of the file system involved.
Apple is still working on it. Contact your neighborhood Apple Developer Technical Support office in 2030.
Any and all trademarks, registered and otherwise, are properties of their owners.