Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!samsung!think!mintaka!snorkelwacker!spdcc!merk!alliant!linus!cvbnet!jsulliva From: jsulliva@cvbnet.UUCP (Jeff Sullivan, x4096 MS 4-2) Newsgroups: comp.sources.wanted Subject: day-of-week algorithm wanted Message-ID: <415@cvbnet.Prime.COM> Date: 2 Feb 90 16:28:32 GMT Sender: postnews@cvbnet.Prime.COM Distribution: usa Lines: 15 References: I am looking for the algorithm (or C source) to figure out the day of the week given a particular date. Such an algorithm is used in most calendar programs, such as 'cal' in Unix. For example: 12/25/1960 Sunday 2/2/2000 Wednesday One simple (brute-force) way is to reset the date in your program and get the time (tm structure). int tm_wday; /* day of week (Sunday = 0) */ There's gotta be a better way! Thanks in advance, -Jeff