home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / mac / programm / 15230 < prev    next >
Encoding:
Text File  |  1992-09-09  |  1.4 KB  |  42 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!news.claremont.edu!nntp-server.caltech.edu!palmer
  3. From: palmer@cco.caltech.edu (David Palmer)
  4. Subject: Re: Look before you Leap
  5. Message-ID: <1992Sep9.155146.5382@cco.caltech.edu>
  6. Sender: news@cco.caltech.edu
  7. Nntp-Posting-Host: sandman
  8. Organization: California Institute of Technology, Pasadena
  9. References: <lanbtrINN8tj@pollux.usc.edu> <1992Sep9.143915.19555@nic.funet.fi>
  10. Date: Wed, 9 Sep 1992 15:51:46 GMT
  11. Lines: 29
  12.  
  13.  
  14. In <lanbtrINN8tj@pollux.usc.edu> suhler@pollux.usc.edu (Paul A. Suhler) writes:
  15.  
  16. >A note for those writing programs that calculate future dates:
  17. >unless I'm mistaken, any year which is integrally divisible by 400
  18. >is NOT a leap year.
  19.  
  20. >Paul Suhler
  21.  
  22. You are mistaken.
  23. If it is divisible by 4 it is a leapyear
  24.     Unless it is divisible by 100
  25.         Unless it is divisible by 400
  26.             Unless it is divisible by 4000
  27.  
  28. So 1992 is a leapyear, 1900 is not (div. by 100), 2000 is (div by 400)
  29. 4000 is not (div by 4000).
  30.  
  31. btw, the 1900 non-leapyear is the reason why the Macintosh designers chose
  32. 1904 as T=0 for the clock.
  33.  
  34. The divisible by 4000 rule has little immediate use, since by that
  35. time, many of the programs now being written will have been upgraded,
  36. and the Earth's periods will have been regularized by people who are
  37. sick and tired of writing leapyear code.
  38.  
  39. -- 
  40.         David Palmer         palmer@tgrs.gsfc.nasa.gov
  41. I am now at Goddard Space Flight Center/NASA, for whom I do not speak.
  42.