[comp.sys.ibm.pc] Will Your SW Make it to the year 2000? another way it can break!

mark@motcsd.UUCP (Mark Jeghers) (06/26/89)

In article <1030@krafla.rhi.hi.is> snorri@rhi.hi.is (Snorri Agnarsson) writes:
>From article <3880@udccvax1.acs.udel.EDU>, by conan@vax1.acs.udel.EDU (Robert B Carroll):
>> In article <4342@druhi.ATT.COM> terrell@druhi.ATT.COM (TerrellE) writes:
>>>Will your software make it into the 21st century?  Does it cope with the
>>>Gregorian calendar reform of the 16th century?

>> if the year is divisible by 4 and not divisible by 100 then its
>> a leap year. who ever counts the year 2000 as a leap yr will have a problem.

>Not so.  If I remember correctly, a year divisible by 100 is a leap year
>if it is divisible by 400.  Therefore the year 2000 is a leap year.

There is another possible way for software to break at 2000!  If dates
have been stored with a "compact" form of the year, for example:

struct date {
	char month[2];
	char day[2];
	char year[2];	/* only the last 2 digits */
};

Since dates will be sorted with they year at the front of the sort key
("890101" > "881231"), there will be a serious error in sorting after
New Years Day, 2000:

"000101" > "991231" ???

Who would be foolish enough to do this, you might say?  More folks than
you think, I've seen it more than once...
-- 
Mark Jeghers                       "I'm the King of Eight and I'm here to state
Motorola Computer Systems              that everything here has to total eight!
....uunet!apple!motcsd!greek!mark          The guards, for instance, at my gate
...hplabs!hpda!/                              must always total exactly eight!"

toma@tekgvs.LABS.TEK.COM (Tom Almy) (06/27/89)

There's no reason to play "wait and see" on this one.  Just set your clock
to 2000 (or even 2001) and check your software today!

Tom Almy
toma@tekgvs.labs.tek.com