home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / rexx / 1511 < prev    next >
Encoding:
Internet Message Format  |  1993-01-25  |  1.5 KB

  1. 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
  2. Organization: Penn State University
  3. Date: Mon, 25 Jan 1993 17:08:53 EST
  4. From: Christopher Sacksteder <CJS@psuvm.psu.edu>
  5. Message-ID: <93025.170853CJS@psuvm.psu.edu>
  6. Newsgroups: comp.lang.rexx
  7. Subject: Re: Date Conversions revisited
  8. References: <REXXLIST%93012509331437@UCF1VM.CC.UCF.EDU>
  9. Lines: 22
  10.  
  11. In article <REXXLIST%93012509331437@UCF1VM.CC.UCF.EDU>, Peter Flass
  12. <FLASS@LBDRSCS.BITNET> says:
  13. >. . .  Specifically I'm looking for a routine which will return
  14. >the day of the week for a given date, . . .
  15.  
  16. From our local tool box:
  17.  
  18.                         /* $TLBEG$ WEEKDAY RXTOOLS 09/19/85 12:01 CJS */
  19. /***********************************************************************
  20. *   W E E K D A Y                                                      *
  21. ***********************************************************************/
  22. Weekday: procedure         /* Contributed by HDK, 9/18/85 */
  23.  arg yyyy,mm,dd
  24.  /*
  25.   Weekday(yyyy,mm,dd) gives the weekday number: 0 for Sun., 1 for Mon.,
  26.     ... 6 for Sat..  Example: Weekday(1970,1,1) == 4 (for Thursday).
  27.     See CACM 15(10):918, REMARK ON ALGORITHM 398, by J.D. Robertson.
  28.  */
  29.  return  ((13*(mm+10-(mm+10)%13*12)-1)%5+dd+77                         ,
  30.          +5*(yyyy+(mm-14)%12-(yyyy+(mm-14)%12)%100*100)%4              ,
  31.          + (yyyy+(mm-14)%12)%400-(yyyy+(mm-14)%12)%100*2)//7
  32.                         /* $TLEND$ WEEKDAY RXTOOLS 09/19/85 12:01 CJS */
  33.