home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!zaphod.mps.ohio-state.edu!caen!batcomputer!ghost.dsi.unimi.it!insa-lyon.fr!univ-lyon1.fr!frmop11!psuvm!cjs
- Organization: Penn State University
- Date: Mon, 25 Jan 1993 17:08:53 EST
- From: Christopher Sacksteder <CJS@psuvm.psu.edu>
- Message-ID: <93025.170853CJS@psuvm.psu.edu>
- Newsgroups: comp.lang.rexx
- Subject: Re: Date Conversions revisited
- References: <REXXLIST%93012509331437@UCF1VM.CC.UCF.EDU>
- Lines: 22
-
- In article <REXXLIST%93012509331437@UCF1VM.CC.UCF.EDU>, Peter Flass
- <FLASS@LBDRSCS.BITNET> says:
- >. . . Specifically I'm looking for a routine which will return
- >the day of the week for a given date, . . .
-
- From our local tool box:
-
- /* $TLBEG$ WEEKDAY RXTOOLS 09/19/85 12:01 CJS */
- /***********************************************************************
- * W E E K D A Y *
- ***********************************************************************/
- Weekday: procedure /* Contributed by HDK, 9/18/85 */
- arg yyyy,mm,dd
- /*
- Weekday(yyyy,mm,dd) gives the weekday number: 0 for Sun., 1 for Mon.,
- ... 6 for Sat.. Example: Weekday(1970,1,1) == 4 (for Thursday).
- See CACM 15(10):918, REMARK ON ALGORITHM 398, by J.D. Robertson.
- */
- return ((13*(mm+10-(mm+10)%13*12)-1)%5+dd+77 ,
- +5*(yyyy+(mm-14)%12-(yyyy+(mm-14)%12)%100*100)%4 ,
- + (yyyy+(mm-14)%12)%400-(yyyy+(mm-14)%12)%100*2)//7
- /* $TLEND$ WEEKDAY RXTOOLS 09/19/85 12:01 CJS */
-