Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!hplabs!hpl-opus!walker From: walker@hpl-opus.HP.COM (Rick Walker) Newsgroups: comp.sources.wanted Subject: Re: day of week algorithm Message-ID: <63140002@hpl-opus.HP.COM> Date: 2 Mar 89 20:49:51 GMT References: <800@sagepub.UUCP> Organization: HP Labs, High Speed Electronics Dept., Palo Alto, CA Lines: 15 / hpl-opus:comp.sources.wanted / dfm@sagepub.UUCP (David F. McCune) / 8:47 pm Feb 27, 1989 / > I used to have a C function that would compute the day > of the week from any given date. You could pass it a > date in the form yymmdd, and it would return an int > in the range 0 - 7, where 0 was invalid date, 1 was > Sunday, 2 was Monday, and so on. > Such a routine appears on page 10 of "Numerical Recipes in C", by William H. Press, et al., Cambridge University Press, 1988. I'm pretty sure that one of Knuth's books has the algorithm also. -Rick Walker