Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!jethro!Sun.COM!acm From: acm@Sun.COM (Andrew MacRae) Newsgroups: comp.lang.pascal Subject: Re: Leap year function Message-ID: <4165@jethro.Corp.Sun.COM> Date: 22 May 91 20:31:58 GMT References: <15921@ms.maus.de> Sender: news@jethro.Corp.Sun.COM Reply-To: acm@Sun.COM (Andrew MacRae) Distribution: world,comp Organization: Sun Microsystems, Mountain View CA Lines: 31 Cc: acm In article <15921@ms.maus.de>, Kai_Henningsen@ms.maus.de (Kai Henningsen) writes: > This, of course, assumes that you will never be interested in years before 1901 > or after 2099. I would prefer not to make such an assumption. Then, the (still > simple) rule is of course It's funny, but in close to fifteen years of programming I have yet to discover a need to handle dates before 1901 or after 2099. Of course I have only developed real-time systems, operating systems, compilers, linkers, and far too many data base applications. Other than a super duper calendar program or a star charting program, I am at a loss to think of a reason to go past those dates in either direction, at least for the purpose of finding the day of the week. In the forward direction, it is rather silly to believe that your pc (or your software) will still be in use in the year 2100. (Yes, yes, I know, maybe the person posting is building a machine that *is* supposed to last that long. Frankly I doubt it.) In the backward direction, the problem with the rule mentioned in the previous posting is that it only takes you back to the year 1722 (I think). That was the year that eleven days were dropped from the calendar. Unless you account for that you are still off. (I may be off on the exact year.) The only program that I am familier with that *does* handle those missing eleven days is a calendar program running (I think) under UNIX. Does anyone have an example (other than the two I mentioned above) where their program had to know the day of the week for a date before 1901 or after 2099? Andrew MacRae