What Day Is It? |
The calendar now in use evolved from the Romans. Julius Caesar codified a calendar system that came to be known as the Julian calendar. In this system, all months have 31 days, except for April, June, September, and November, which have 30 days, and February, which has 28 days in non-leap years, and 29 days in leap years. Also, in this system, leap years happened every four years. That is because the astronomers of ancient Rome computed the year to be 365.25 days long, so that after every four years, one needed to add an extra day to keep the calendar on track with the seasons. To do this, they added an extra day (February 29) to every year that was a multiple of four.
In 1582, Pope Gregory's astronomers noticed that the year was not 365.25 days
long, but closer to 365.2425. Therefore, the leap year rule would be revised to the following:
To compensate for how the seasons had shifted against the calendar up until
that time, the calendar was actually shifted 10 days: the day following October 4, 1582 was declared to be October 15.
England and its empire (including the United States) didn't switch to the
Gregorian calendar system until 1752, when the day following September 2 was
declared to be September 14. (The delay was caused by the poor relationship
between Henry VIII and the Pope.)
Write a program that converts dates in the United States using a calendar of the
time and outputs weekdays.
11 15 1997 1 1 2000 7 4 1998 2 11 1732 9 2 1752 9 14 1752 4 33 1997 0 0 0
November 15, 1997 is a Saturday January 1, 2000 is a Saturday July 4, 1998 is a Saturday February 11, 1732 is a Friday September 2, 1752 is a Wednesday September 14, 1752 is a Thursday 4/33/1997 is an invalid date.