CompuServe Messages

Calendar conversions

    01-Apr-95 21:55:28
Fm: Eduard Joseph 74603,3262
To: William Barnes 73060,65
Looking quickly at my sample codes I found this one. This one should work OK, and its a lot cleaner /* REXX routine that returns index of week, 1 = monday. */ /* requires year to be a 4 digit year */ DayOfTheWeek: PROCEDURE PARSE ARG month, day, year IF ((month = 1) | (month = 2)) THEN DO month = month + 12 year = year – 1 END leapyear = (year % 4) – (year % 100) + (year % 400) RValue = ((day + (2 * month) + (3 * (month + 1) % 5 ) + year + leapyear) // 7) + 1 RETURN RValue say DayOfTheWeek(4,2,1995) /* should return 7 */ well I hope this one those it Eduard Joseph