Guest.Visitor
01-07-2002, 04:04 PM
Many times in the past people have asked about how to compute the Day of the Week given the year month and day; Here's one that I use. I tested it against objrexx and S390/rexx date functions over a 400 year cycle of the Gregorian Calendar. a = (14 - month) % 12; y = year - a; m = month + 12*a - 2; d =1 + (day + y + (y % 4) - (y % 100) + (y % 400) + ((31 * m) % 12)) // 7 ; { % is integer divide; // is MOD for the C-Heads } if d = 1 then DOWK = Sunday et c.
dowk.rex (http://www.mcpressonline.com/images/fbfiles/files/3d43a9ff_dowk.rex)
dowk.rex (http://www.mcpressonline.com/images/fbfiles/files/3d43a9ff_dowk.rex)