Path: utzoo!attcan!uunet!wuarchive!emory!hubcap!ncrcae!ncrlnk!ncrwat!images1!jrl From: jrl@images1.Waterloo.NCR.COM (john Latala) Newsgroups: comp.sys.handhelds Subject: Re: Leap Years Message-ID: <1010@ncrwat.Waterloo.NCR.COM> Date: 15 Aug 90 04:25:54 GMT References: <31210047@hpcvia.CV.HP.COM> <6758.26c2a07b@jetson.uh.edu> Sender: news@ncrwat.Waterloo.NCR.COM Reply-To: john.Latala@Waterloo.NCR.COM Organization: NCR Canada Ltd, Waterloo, Ontario, Canada. Lines: 54 Keywords: In article <6758.26c2a07b@jetson.uh.edu> math1i7@jetson.uh.edu writes: >In article <31210047@hpcvia.CV.HP.COM>, scottb@hpcvia.CV.HP.COM (Scott_Burke) writes: >> >> Would someone please verify that I have the leap year algorithm correct: >> >> February has 28 days UNLESS the year is divisible by 4, in which case >> February has 29 days UNLESS the year is divisible by 100, in which case >> February has 28 days UNLESS the year is divisible by 400, in which case >> February has 29 days. > >Scott, I have never heard about the 100 and 400 year rules... I had always >assumed that: > IF 0 year 4 MOD == THEN 28 ELSE 29 END >Are the 100 and 400 year rules there to correct for the fraction of >a second off each year is from a "true" 365 or 366 days? There's a neat pair of books about doing astronomical calculations: Practical Astronomy with your Calculator and Practical Astronomy with your PC both books are by Peter Duffet-Smith. They have a nice section talking about date and time routines for converting from 'normal' date to the astronomical Julian Date. In the one section there's a nice disscussion about all the date stuff: " ... Before 5th October, 1582 the Julian calendar was in general use in Europe. By this calendar there were 365 days in each year except if the year number was divisible by 4, then there were 366. This variation was incorporated to make some allowance for the fact that the length of the year, i.e. the time taken by the Earth to complete one orbit around the Sun, is not a whole number of days. The length of the tropical year is in fact 365.2422 days, and by adopting the convention of a leap year every fourth year, the average Julian year is 365.25 days. This worked quite well for hundreds of years, until 1582 astronomers were worried by the accumulate error which had built up through the difference between the tropical year and the Julian year. Accordingly, Pope Gregory decreed that the dates 5-14th October 1582 inclusive were to be abolished (to readjust the seasons to their correct positions) and that years ending in two zeros (1700, 1800, etc.) were only leap years if divisible by 400. By this device, 400 civil years contained (400 * 365) + 100 - 3 = 146097 days. The average length of the civil year was then 146097 / 400 = 365.2425 days, a much better approximation to the length of the tropical year." Quoted without permission from "Practical Astronomy with your PC" by Peter Duffet-Smith, Cambridge University Press, ISBN 0-521-38995-X (paperback), Second Edition, Pages 15-16. Any spelling errors and/or typos are probably mine...... -- john.Latala@Waterloo.NCR.COM