Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!usc!orion.oac.uci.edu!uci-ics!zardoz!anacom1!jim From: jim@anacom1.UUCP (Jim Bacon) Newsgroups: comp.lang.c Subject: Re: Computing Day of the Week Keywords: given month and day Message-ID: <365@anacom1.UUCP> Date: 9 Dec 89 22:20:24 GMT References: <1894@ntmtka.mn.org> Reply-To: jim@anacom1.UUCP (Jim Bacon) Distribution: usa Organization: Anacom CPD, Anaheim, CA Lines: 20 In article <1894@ntmtka.mn.org> mike@ntmtka.mn.org (Mike Tietel) writes: >I know there exists an algorithm to compute the day of the week, >given the month, day and year. For example, what day of the week >is September 13, 1998? > >Does anyone know where I can find the algorithm, or alternatively, >where I can find its "C" implementation??? > The book "Common C Functions" published by Que contains a very good section on date manipulation routines including the Zeller congruence routine you are looking for. Source is given in C for the IBM PC, but is portable with little or no change to UNIX. The other routines are for doing Julian conversions and date math. I have found them to be quite useful and have incorporated them into our local library. -- Jim Bacon | "A computer's attention span is only Anacom General Corp., CA | as long as its extension cord." jim@anacom1.cpd.com | zardoz!anacom1!jim | Anon