Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!gem.mps.ohio-state.edu!tut.cis.ohio-state.edu!pt.cs.cmu.edu!b.gp.cs.cmu.edu!ralf From: ralf@b.gp.cs.cmu.edu (Ralf Brown) Newsgroups: comp.binaries.ibm.pc.d Subject: Re: Looking for D.O.W. algorithm Keywords: weekday Message-ID: <6180@pt.cs.cmu.edu> Date: 18 Sep 89 19:39:06 GMT References: <6470@hubcap.clemson.edu> <1839@sactoh0.UUCP> <766@chyde.uwasa.fi> <1989Sep18.165034.19753@agate.berkeley.edu> Organization: Carnegie-Mellon University, CS/RI Lines: 24 In article <1989Sep18.165034.19753@agate.berkeley.edu> hughes@math.berkeley.edu (Eric Hughes) writes: }>bios call only returns the *current* weekday, but for *any* weekday }>an algorithm is needed. } }The standard trick under MSDOS is to save the current date, then set }the date to the desired one, get the day of the week, and finally }reset the date to the real one. Which of course is not too nice if you're running a multitasker and another task asks for the date in the middle of the above process.... }Oh, and if you want to do this for dates previous to the 15th century, }you'll need to take into account various calendar adjustments that }were made. :-) Don't forget to include a database of which adjustments were made when by which countries (Russia didn't switch from Julian until early this century, England and the at-that-time American colonies switched in 1752). -- {backbone}!cs.cmu.edu!ralf ARPA: RALF@CS.CMU.EDU FIDO: Ralf Brown 1:129/46 BITnet: RALF%CS.CMU.EDU@CMUCCVMA AT&Tnet: (412)268-3053 (school) FAX: ask DISCLAIMER? |"Humor is laughing at what you haven't got when you ought to What's that?| have it." -- Langston Hughes