home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!news.claremont.edu!nntp-server.caltech.edu!palmer
- From: palmer@cco.caltech.edu (David Palmer)
- Subject: Re: Look before you Leap
- Message-ID: <1992Sep9.155146.5382@cco.caltech.edu>
- Sender: news@cco.caltech.edu
- Nntp-Posting-Host: sandman
- Organization: California Institute of Technology, Pasadena
- References: <lanbtrINN8tj@pollux.usc.edu> <1992Sep9.143915.19555@nic.funet.fi>
- Date: Wed, 9 Sep 1992 15:51:46 GMT
- Lines: 29
-
-
- In <lanbtrINN8tj@pollux.usc.edu> suhler@pollux.usc.edu (Paul A. Suhler) writes:
-
- >A note for those writing programs that calculate future dates:
- >unless I'm mistaken, any year which is integrally divisible by 400
- >is NOT a leap year.
-
- >Paul Suhler
-
- You are mistaken.
- If it is divisible by 4 it is a leapyear
- Unless it is divisible by 100
- Unless it is divisible by 400
- Unless it is divisible by 4000
-
- So 1992 is a leapyear, 1900 is not (div. by 100), 2000 is (div by 400)
- 4000 is not (div by 4000).
-
- btw, the 1900 non-leapyear is the reason why the Macintosh designers chose
- 1904 as T=0 for the clock.
-
- The divisible by 4000 rule has little immediate use, since by that
- time, many of the programs now being written will have been upgraded,
- and the Earth's periods will have been regularized by people who are
- sick and tired of writing leapyear code.
-
- --
- David Palmer palmer@tgrs.gsfc.nasa.gov
- I am now at Goddard Space Flight Center/NASA, for whom I do not speak.
-