Computing Day of the Week

Jim Bacon jim at anacom1.UUCP
Sun Dec 10 09:20:24 AEST 1989


In article <1894 at ntmtka.mn.org> mike at 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 at anacom1.cpd.com                  |
zardoz!anacom1!jim                   |                                 Anon



More information about the Comp.lang.c mailing list