Gauss, among others, gave formulas for determining the day of the week from the date (which I modified slightly from the reference below).
The MAPLEV4 calendar package implements these formulas. The MAPLEV4 worksheet gives an example of this. There are two calendars implemented: the Gregorian (after 1582) and the Julian calendars. The default is the Gregorian.
If you have MAPLEV4 and Windows 3.1 or better then here is how to load the calendar package:
read(`c:/maplev4/share/games/calendar/calendar.mpl`);
day_of_week(5,21,1996);
day_of_week(5,21,1996,`J`);