On Fri, 27 May 2005 01:07:27 GMT, in bit.listserv.ibm-main
(Message-ID:<[EMAIL PROTECTED]>)
"gerard46" <[EMAIL PROTECTED]> wrote:
Here is a REXX subroutine that calculates the day-of-week
from a mm/dd/yyyy date (year must be four digits):
Again, if he has mm/dd/yyyy, why not use the built-in
function to get the name of the weekday?
yyyy = right(year,4,'0')
mm = right(month,2,'0')
dd = right(day,2,'0')
yyyymmdd = yyyy || mm || dd
dow = date("W",yyyymmdd,"S")
which could be made into a one-liner, but it would be
line-wrapped by my mail program.
If you really need a number, just set up a stem variable:
daynum.Sunday = 0 /* or 1 or whatever number you want */
daynum.Monday = daynum.Sunday + 1
etc.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html