What is Zeller's Congruence and Calendar Modulo Mathematics?
Mathematical Foundation
Laws & Principles
- The January/February Shift Rule: In Zeller's Congruence, January and February must be historically counted as months 13 and 14 of the PREVIOUS year in order to push the leap-day (Feb 29) to the absolute end of the mathematical equation.
- The 400-Year Gregorian Cycle: The calendar repeats exactly every 400 years. If a date falls on a Tuesday in 2024, it will fall on the exact same Tuesday in 2424. There are exactly 97 leap years per 400-year cycle.
- The Julian to Gregorian Jump: In October 1582, 10 days were entirely skipped to realign the calendar with the solar year. Thursday, October 4th, 1582 was immediately followed by Friday, October 15th, 1582. Most mathematical algorithms fail if tracking days before this jump.
Step-by-Step Example Walkthrough
" Calculating the day of the week for July 4, 1776 (The signing of the Declaration of Independence). "
- 1. Identify the variables: q = 4 (Day), m = 7 (July), K = 76 (Year of Century), J = 17 (Century).
- 2. Add the day term: 4
- 3. Add the month term: floor(13 * (7 + 1) / 5) = floor(104 / 5) = 20
- 4. Calculate year terms: 76 + floor(76 / 4) + floor(17 / 4) - 2(17) = 76 + 19 + 4 - 34 = 65
- 5. Sum all terms: 4 + 20 + 65 = 89
- 6. Apply modulo 7: 89 mod 7 = 5.