ANS85 

Date Conversion Functions

Date conversion functions are of type integer. The Gregorian calendar is used in the date conversion functions. The starting date of Monday, January 1, 1601, was chosen to establish a simple relationship between the date and DAY-OF-WEEK; that is, the integer date 1 was a Monday, DAY-OF-WEEK 1.

For example, the statement:

compute DoW = 
     function rem (function integer-of-date (date-field) , 7)

returns the day of week for a given date, where 0 is Sunday, 1 is Monday, and so on.