Y2k Leap year problem?

greenspun.com : LUSENET : Electric Utilities and Y2K : One Thread

I've been looking at all the articles about the many problems with Y2K, but no where have I seen any mention of a small but secondary problem with the 2000 being a leap year. If I'm correct in what I've been told, the year 2000 will NOT be a leap year because every 400 years we do not add a day to febuary. I know that in the 60's and 70's a lot of COBOL routines where written, where you divide by 4 and if the result was zero it was a leap year and you add 1 to the julian date counter or subc-script in the program. Several problems occurred in the industry in 1996 because of the same type problemwith not identifing a leap year. I've check my Microsift calendar and apparently Bill Gates does't know either, it shows a feb. 29th.

-- Anonymous, April 29, 1998

Answers

Ed,

The Year 2000 is most definately a leap year. No questions about it.

As a reference, please see the following:

Dr. John Stockton's Date and Time Miscellany

Also, the Year 2000 FAQ.

Hope this helps.

-- Anonymous, April 29, 1998


It's the other way 'round. 2000 IS a leap year. The leap year rules are

1) every year divisible by four is a leap year,

2) except years that end with 00,

3) unless the year is divisible by 400.

So 1700, 1800, 1900 were not leap years, but 2000 is. Software that uses rules one and two, but not three, gets it wrong.

-- Anonymous, April 29, 1998


The year 2000 is definitely a leap year. I first became aware of the Year 2000 Problem back in 1978 when I was programming for a weather satellite at NASA. We had a problem that occurred on a month boundary: the date was encoded as an integer YYMMDD, and because of a misunderstanding between two groups, the previous day's date was obtained by subtracting one from the current day's date. This caused problems when the program attempted to retrieve the satellite's position for the previous day.

I was the one who fixed the problem by encapsulating all usage of the date variable into a subroutine call, and handling the calendar internally. I initially got the century leap year exception wrong, but checked with an encyclopedia and fixed it. I now wonder if some sloppy (but currently workable) leap year code checks for divisibility by 4 (which will work untill 2100) will still be in use then.

-- Anonymous, April 30, 1998


Moderation questions? read the FAQ