I found this very complex mathematical formula that allows one to figure out the day of the week any date falls on. Don’t let the formula intimidate you! I did this with some 3rd graders and with a few explanations, they were able to figure it out. So can you!
Spark your math thinking!
- Set up your math mini spark recording page: #30: What day of the week is it?
- Watch this tutorial to learn the process. Write down the formula on your recording page.
3. Figure out the day of the week you were born on using your birthdate and year. Add your math steps to your recording page.
4. Use the formula to find the day of the week for one of these dates. Do your math steps on paper.
- July 20, 1969: Apollo 11 landed on the Moon, and Neil Armstrong became the first person to walk on the lunar surface.
- March 10, 1876: The first telephone call was successfully made by Alexander Graham Bell, a pivotal moment in global communication history.
- April 6, 1896: The first modern Olympic Games opened in Athens, Greece, reviving the ancient Greek tradition and promoting international sport and goodwill.
5. Check this date calculator to see if you did the math correctly. How did you do on step #3 and #4?
6. OPTIONAL: Scroll down to the bottom of this post to read about the Zeller’s Algorithm in JavaScript code that is used to find out the day of the week. Write down some patterns that you notice in the code.
7. Share your math mini spark recording page with your teacher/EY coordinator.
Check out another method to find an exact day with this math mini spark #90.

Zeller’s Algorithm in JavaScript
Zeller’s Algorithm takes year, month and day numbers and uses some basic math (+ − × ÷) and the floor function (which removes any digits after the decimal point).
This is what it looks like in JavaScript (parseInt is used instead of floor):
if (nMonth >= 3) {
nMonth -= 2;
} else {
nMonth += 10;
}
if ((nMonth == 11) || (nMonth == 12)) nYear--;
var nCentury = parseInt(nYear / 100);
var nYear100 = nYear % 100;
var h = 0; // day of week number
h += parseInt(nDay);
h += parseInt((13 / 5) * nMonth - 0.2);
h += parseInt(nYear100);
h += parseInt(nYear100 / 4);
h += parseInt(nCentury / 4);
h -= parseInt(2 * nCentury);
h %= 7;
if (nYear >= 1700 && nYear <= 1751) {
h -= 3;
} else {
if (nYear <= 1699) h -= 4;
}
if (h < 0) h += 7;
