WITH Ada.Calendar;
PACKAGE DayWeek IS
-------------------------------------------------------------------------
--| Finds the day of the week on which a given date falls.
--| Created by Jason Guthrie 4/18/92
--| modified by Michael Feldman 4/28/92 and 9/30/96
--| The formula allows for dates within the range of package Ada.Calendar
-------------------------------------------------------------------------
SUBTYPE DaysOfWeek IS Integer RANGE 0..6;
-- numerical code for days of the week:
-- Monday = 0, Tuesday = 1, etc.
FUNCTION DayOfWeek (Month: Ada.Calendar.Month_Number;
Day : Ada.Calendar.Day_Number;
Year : Ada.Calendar.Year_Number) RETURN DaysOfWeek;
-- Pre: Month, Day, and Year are defined
-- Post: returns the day of the week corresponding to the given
-- month, day, and year. No check is made to insure that the
-- month/day/year combination form a valid date.
END DayWeek;