From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,287e8ed2b0c0aabf X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-07-24 14:45:45 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!paloalto-snf1.gtei.net!denver-snf1.gtei.net!news.gtei.net!coop.net!newsfeed1.global.lmco.com!svlnews.lmms.lmco.com!not-for-mail From: Paul A Storm Newsgroups: comp.lang.ada Subject: Re: Zeller's Algorithm Date: Wed, 24 Jul 2002 14:30:48 -0700 Organization: alphabetically please Message-ID: <3D3F1C88.B430AC1F@lmco.com> References: <3D3DED1F.24DE3AC8@lmco.com> NNTP-Posting-Host: 129.197.52.149 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.79 [en] (X11; U; SunOS 5.6 sun4u) X-Accept-Language: en Xref: archiver1.google.com comp.lang.ada:27369 Date: 2002-07-24T14:30:48-07:00 List-Id: Thomas Wolf wrote: I downloaded your code and ran the test routine, np. I'll check out the contents. I had already decided to use a Julian conversion with a mod 7 as a basis for "Plan B". Thanks for your reply. I am still confused as to why the Zeller algorithm wouldn't work. Since the algorithm has been around since 1875 I figure it has proven out. Although I am still cogitating on whether it takes into account for centennial non-leap years(1800,1900, etc.) and quatra-centennial leap years(i.e. 2000). It bugs me when I can't figure out the reason for some code not working. Know what I mean? Did you try to compile the program from the link I gave and did you have any problems like I had? > > paul.a.storm@lmco.com wrote: > > Help! > > > > I am trying to find a Ada implementation of Zeller's algorithm that > > works! I have found several on the web > > but none of them have worked right. > > > > For example I tried this one from > > http://www.adapower.com/alg/zeller.html Inputting June 19 2002 returns > > Wednesday, correct. Inputting June 19 1999 produces Sunday, incorrect. > > That's a Saturday. Inputting > > February 3, 2002 produces Friday, incorrect. That's a Sunday. What > > gives? > > > > I have had similar weird results using other similar Ada Zeller versions > > I've found on the web. > > You might try the Util.Calendar packages from my Util subsystem, > available at the URL > > http://home.tiscalinet.ch/t_wolf/tw/ada95/util/ > > Util.Calendars.Universal.Day_Of_Week produces the correct results. > See the test driver in ./test/calendar_test.adb for some examples. > > The Util subsystem is published under the GMGPL. > > -- > ----------------------------------------------------------------- > Thomas Wolf e-mail: t_wolf@angelfire.com -- My perspicacity is only eclipsed by my pertinacity