[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Y2k problems on a IIgs w/ProDOS 4.0.2



<greg@apple2.com> wrote:

> In article <1dz4aqs.1s91h2b1czg24gN@dempson.actrix.gen.nz>,
> dempson@actrix.gen.nz (David Empson) wrote:
> 
> > The IIgs clock is implemented the same way as the Mac: the clock chip
> > uses a four byte register which increments every second (the base year
> > is probably 1904, as with the early Mac models).
> 
> Why do the people responsible for such things never consider making the
> base year the year that the first prototype for that computer was made?
> Do they really think there's a possibility that people will be using an
> Apple IIgs in 1904 (or 1940)?

The reasoning behind the 1904 base year is clear: it allows for a
simplification in the leap year calculations.

Starting in 1904, every fourth year is a leap year, until you get to
2100, which isn't a leap year (neither was 1900).

A 32-bit second counter has a period of just over 136 years, so a base
date of 1904 gives an expiry date in 2040.

While still avoiding 2100, the base date could be advanced as far as
1952 (with an expiry date of 2098).  In fact, I think some of the later
Macs did this, though I seem to remember 1956 being the base year, which
would defeat the argument about 2100 and leap years.


The choice of a base year with this type of clock is completely
arbitrary, and a newer operating system (or a patch) can change the base
year, as long as it is clear how the number should be interpreted.

For example, considering a base year of 1904, an OS patch could redefine
all the values with the high order bit clear (originally 1904 through
1972) to now start in 2040, allowing the clock to be set as far ahead as
2108 (but no earlier than 1972).

Some time after 2040, the time could be redefined so that the clock
starts in 2040, allowing a further 68 years later down the track.

This procedure can be repeated indefinitely, though the lifetime of the
computer in question probably doesn't justify it.

-- 
David Empson
dempson@actrix.gen.nz
Snail mail: P O Box 27-103, Wellington, New Zealand