Day of the Week
Find the day of the week for any date from year 1 to 9999. Solution by Zeller's congruence, day of the year, week number and month calendar.
The day of the week calculator finds the weekday of any date from year 1 to 9999 — a birthday, a historical event or a future holiday. The solution uses Zeller's congruence and also shows the day of the year, the week number, the quarter and a calendar of the month.
Zeller's congruence
h = (q + [13(m + 1)/5] + K + [K/4] + [J/4] + 5J) mod 7
- q is the day of the month, m the month (March = 3, …, December = 12; January and February count as months 13 and 14 of the previous year);
- K is the last two digits of the year, J the century (leading digits);
- [x] is the integer part, mod 7 the remainder after division by 7.
| h | 0 | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|---|
| Day | Sat | Sun | Mon | Tue | Wed | Thu | Fri |
Example. July 20, 1969 (Moon landing): q = 20, m = 7, K = 69, J = 19.
h = (20 + [13·8/5] + 69 + [69/4] + [19/4] + 5·19) mod 7 = (20 + 20 + 69 + 17 + 4 + 95) mod 7 = 225 mod 7 = 1 — Sunday.
The formula is for the Gregorian calendar, introduced in 1582 (in Britain and its colonies in 1752).
Comments
No comments yet.