Path: utzoo!attcan!uunet!cs.utexas.edu!rutgers!apple!motcsd!hpda!hpcupt1!hpsal2!morrell From: morrell@hpsal2.HP.COM (Michael Morrell) Newsgroups: comp.sources.wanted Subject: Re: Day of week routine Message-ID: <9490003@hpsal2.HP.COM> Date: 26 May 89 00:48:37 GMT References: <234@zeek.UUCP> Organization: HP System Architecture Lab, Cupertino Lines: 18 / hpsal2:comp.sources.wanted / rjd@occrsh.ATT.COM (Randy_Davis) / 7:46 am May 24, 1989 / In article <234@zeek.UUCP> larry@zeek.UUCP (Larry Podmolik) writes: |I need a C function that, given a date, would return what day of the |week it fell on. Of course, I didn't think to save it at the time. Well, this is not C, but it is a cheap and easy shell script that will do the same, based on the "cal" command. Randy Davis UUCP: ...(att!)ocrjd!randy ...(att!)occrsh!rjd [script deleted] ---------- Nice try, but the script unfortunately relies on each week in cal's output to have seven numbers in it. It fails on days in the first week of a month if it does not start on a Sunday (e.g., try "dow 5 1 89"). Michael