It can be considered to be based on the conversion between Julian day and the calendar date.
Each term within the formula is used to calculate the offset needed to obtain the correct day of the week.
Since the Gregorian calendar was adopted at different times in different regions of the world, the location of an event is significant in determining the correct day of the week for a date that occurred during this transition period.
The Julian calendar is in fact proleptic right up to 1 March AD 4 owing to mismanagement in Rome (but not Egypt) in the period since the calendar was put into effect on 1 January 45 BC (which was not a leap year).
In addition, the modulo operator might truncate integers to the wrong direction (ceiling instead of floor).
However, for 1 March 2000, the date is treated as the 3rd month of 2000, so the values become so the formula evaluates as
The formulas rely on the mathematician's definition of modulo division, which means that −2 mod 7 is equal to positive 5.
Unfortunately, in the truncating way most computer languages implement the remainder function, −2 mod 7 returns a result of −2.
So, to implement Zeller's congruence on a computer, the formulas should be altered slightly to ensure a positive numerator.
One can readily see that, in a given year, the last day of February and March 1 are a good test dates.
Utilizing this approach, we can avoid the worries of language specific differences in mod 7 evaluations.
Zeller used decimal arithmetic, and found it convenient to use J and K values as two-digit numbers representing the year and century.
For the Julian calendar, Zeller's congruence becomes The algorithm above is mentioned for the Gregorian case in RFC 3339, Appendix B, albeit in an abridged form that returns 0 for Sunday.
At least three other algorithms share the overall structure of Zeller's congruence in its "common simplification" type, also using an m ∈ [3, 14] ∩ Z and the "modified year" construct.
Both expressions can be shown to progress in a way that is off by one compared to the original month-length component over the required range of m, resulting in a starting value of 0 for Sunday.
Each of these four similar imaged papers deals firstly with the day of the week and secondly with the date of Easter Sunday, for the Julian and Gregorian calendars.