This mathematical trick lets you calculate the weekday for any date
Share:
Whether you're trying to plan your next birthday party or looking ahead to your wedding anniversary, you'll quickly find yourself wondering what day of the week the milestone will fall on. And while there's always the calendar on your phone to help you plan, wouldn't it be great if you could quickly work out the relevant date in your head?.
Well, thanks to a mathematical trick, previously explained on Forbes' website, now you can. The trick, dubbed Zeller's formula, gives you the day of the week for any date by using this method: d=k+[(13m-1)/5]+D+[D/4]+[C/4]-2C mod 7. The terms are defined as d being the day of the week, with zero meaning Sunday, one referring to Monday and so on, until you get Saturday as six, and k is the date of the month, D is the last two numbers of the year and C is the century.
However, January and February are the 11th and 12th months, since the trick only works if you count March as number one. For instance, if you want to work out which day December 7, 1941 fell on, you would use the terms as so: k = 7, D = 41, C = 19, m = 10.
It works out to show the formula as d=7+[(13x10-1)/5]+41+[41/4]+[19/4]-2x19 mod 7. If you work out the sums in the brackets first, this will leave you with, 7+25+41+10+4-38 mod 7. Whether you're trying to plan your next birthday party or looking ahead to your wedding anniversary, you'll quickly find yourself wondering what day of the week the milestone will fall on (stock photo).