Day for any Date Online Toolbox

Published on Sunday, August 28, 2011 in , , ,

Dafne Cholet's Calendar* photoI teach a version of Day of the Week For Any Date feat, also known as the human calendar feat, here on Grey Matters, but I thought it was time to look into this feat in more detail.

To help you get a more complete picture, I've put together a Day for any Date Online Toolbox. Best of all, each one of these tools can be accessed for free!


Gregorian Calendar: The calendar we use today wasn't developed until 1582, so most days of the week before 1583 can't be calculated using the formulas we'll be examining. In Britain and its American colonies, it wasn't adopted until 1752. Some countries, including Greece and Russia, began using it less than 100 years ago. For a fascinating look at the history of humanity's search for an accurate calendar, check out James Burke's Infinitely Reasonable.

Leap Years: Most people think of leap year as being every 4 years. It's important to realize that years ending in 00 are only leap years if they're evenly divisible by 400. For example, 2000 was a leap year, while 1900 and 1800 were not. The next year ending in 00 that will be a leap year will be 2400. Thanks to this rule, the calendar repeats exactly every 400 years.

Modular Arithmetic: If there's one thing you're going to have to know when doing any version of the day for any date feat, it's modular arithmetic, also known as “Calendar and Clock Arithmetic”. Specifically, you're going to need to know how to take a number and work out modulo 7. If you remember doing problems like 23 ÷ 7 = 3 with a remainder of 2, then working out any number modulo 7 is easy. Modular arithmetic focuses only on the remainder, so 23 modulo 7 would just be 2 (the remainder of 23 ÷ 7)! Obviously knowing your multiples of 7 helps greatly.

Key Numbers: Almost every system for calculating days of the week include turning the year, month, and day into adjustment numbers commonly referred to as key numbers, or simply keys. Often, people who have learned one way of calculating run into others who do the same feat, and they're shocked to find that their key numbers are different. The key number can be changed, as long as they all compensate for the change in the same way. I've run across one method that used 1 for a Sunday and 7 for a Saturday (most day keys, due to the mod 7 calculation, run 0 through 6), yet it always gave the correct date, because the rest of their system compensated for this.

Day of the Week Keys: For most version of the calendar feat, you'll find that 0=Sunday, 1=Monday, 2=Tuesday (very easy to remember!), 3=Wednesday, 4=Thursday, 5=Friday, and 6=Saturday. Even people who are used to calendars that have Monday as the first day of the week use this, since 1=Monday. Again, variations of this system will still work out as long as the other keys properly compensate.

Mnemonics: Mnemonics aren't required to perform calendar calculations, but they do allow you to speed up the process by helping you to recalling the results of other calculations, rather than actually working them out during the feat itself. If you choose this route, and I highly recommend you do, take the time to learn and practice the Link System, the Number Shape or Number Rhyme systems, and the Major/Peg System (all accessible through the link above).

Perpetual Calendars: One of the original drawbacks of doing this feat was the need to carry a perpetual calendar around with you, so the audience could verify the day. They ranged from impressive monstrosities to ingenious mechanical devices. Today, a free app on your mobile device, or even someone else's, as they're likely to trust it more, are easily available, making this feat more commercial than ever before!

Year Key Number

In calendar calculations, a mention the year specifically refers to the rightmost two digits (such as the 11 in 2011), as the other part of the full year isn't considered unless adjustments for the century are required.

(year + ⌊year ÷ 4⌋) mod 7: Straight out of Zeller's congruence (denoted as K in the formula at the link), this is the classical formula for determining a key code for the year from 0 to 6. The odd-looking L-shaped bars (⌊ and ⌋) refer to the floor function, which simply means to drop any fractional parts remaining after the divison. For 1987, you'd do (87 + ⌊87 ÷ 4⌋) mod 7 = (87 + ⌊21.75⌋) mod 7 = (87 + 21) mod 7 = 108 mod 7 = 3, so the code for 87 would be 3. This many mathematical steps is not something that is easily done under pressure of performance, so alternatives have been developed.

Decade and Leap Year Offset: In this method you memorize keys for each decade then add the last digit of the year, then add 1 more for each leap year inbetween. Since you're recalling 1 of only 10 numbers, and only adding and doing a mod 7 calculation, this is obviously quicker. If you work through the system as described at the link, you'll see that 1987 becomes a 4, not a 3. As mentioned earlier, it still gives the correct date, since the rest of the system compensates for that difference.

“Dozens, remainder, and fours in the latter...”: This approach, and the particular phrasing, comes from John Horton Conway's Doomsday approach. You start with how many full sets of 12 years (“Dozens”) have passed, which, in our 87 example, would be 7 (7 × 12 = 84), to which we add the remaining years of 3, which gives 7 + 3 = 10. No leap years happened between 1984 and 1987, so we stay with 10. 10 mod 7 gives us 3 once again! This is a slightly easier variation of the decade approach above.

28 Year Pattern: If two years are a multiple of 28 years apart, and they both begin with the same 2 digits (For example, 1902 and 1958 are 56, or 28 × 2, years apart, and both begin with 19), then you can always count on their calendars to be exactly the same. You can take advantage of this by memorizing the key for only the first 7 years that are multiples of 4 (00 -regardless of leap year status-, 04, 08, 12, 16, 20, and 24), and then realizing that every other year is covered by adding 28, 56 or 84 years (again, as long as the first two digits remain the same). The non-leap years can be covered by just adding the difference in years. For 1987, we realize that 1900 (even though it wasn't a leap year) has a key of 0, thus so does 1984. 1987 is 3 years later, so 0 plus gives us 3 once again!

Mnemonics: As I mentioned earlier, this is usually the fastest approach for getting the year key. You can consult a chart or do the calculation earlier, and simply use mnemonics to recall those results during performance. For 1987, I'd use one of the above methods to work out that 87 means a 3, and then link FoG (87 in the Major/Peg system becomes FoG) to lips (3 in the Number Shape System looks like the side view of a pair of lips), perhaps by thinking of a day that's so foggy I can only see a pair of lips approaching me. During performance, all you do is think, “87 → FoG → lips → 3” and you've got the year key!

No Year Key: Some people do a simple version of the Day for any Date feat by working out dates that are only in the current year. As long as the rest of the keys take that into account, you can get away with not using a year key!

Month Key Number

January, of course, has 31 days. That's four full 7 day weeks, plus another 3 days. So, when you go to figure a key for the month of February, it's always going to have a key that's 3 numbers greater than January. Basically, whatever number is used for January, the other months will always have the same consistent relation.

Those who learned the feat in the 20th century usually used the following system:
  • January = 0
  • February = 3
  • March = 3
  • April = 6
  • May = 1
  • June = 4
  • July = 6
  • August = 2
  • September = 5
  • October = 0
  • November = 3
  • December = 5
Groups: It can help just to remember groups of 3 or 4 numbers together, as in a telephone number or ID card. For example, at that link, the month keys as grouped as 622-503-514-624. It's still easy to determine which number goes with which month.

Similar Months: If often helps to categorize the months by their number. This can help in determining which months in a given year begin on the same days. For example, September and December will always start on the same day of the week, and May and June will never be like any of the other years.

Mnemonics: At this link, I give some very simple mnemonics for the month keys (scroll down to the bottom of the post), with the assumption that they're being used to calculate dates from 2000 to 2099 (compare them to the above numbers, they're all 1 less).

Doomsday: This is where John Horton Conway's Doomsday approach really shines. For a given year, you only need to know 1 simple key! As long as you know the date on which the last day of February will fall in a given year, you can work out the day of the week for ANY date in that same year! Bonus Tip: If you've used mnemonics to remember your year keys, you can always find one number to add that will always give you the last day of February (this will change for different centuries, of course), thus allowing you to quickly adapt to working with the Doomsday approach.

Practice, Practice, PRACTICE!

Day of the Week For Any Date Quiz (Revised): This is a step-by-step quiz, used in guiding you along the particular step-by-step approach I teach. However, the Dates: 2000-2099 button and the Dates: 1600-2399 button can be used to test yourself regardless of the system you use.

Mind Magician's Day for any Date System: At the bottom of this tutorial is an interactive quiz that not only gives you feedback on whether you were correct, but also your average time.

Random.org's Calendar Dates: Random.org will give you random calendar dates, but it won't tell you on which day they fell. If you use this page as a quiz, you'll need to provide your own perpetual calendar.

Free Mobile Apps: Regardless of your chosen mobile operating system, you can almost always find free apps to quiz you on day of the week for any date. Many that aren't intended to quiz you can often be adapted by using a random setting and covering the place that displays the day of the week.

Spread The Love, Share Our Article

Related Posts

Post Details

3 Response to Day for any Date Online Toolbox

11:52 AM

This is really helpful! Thank you!

4:45 PM

To remember all the year keys I use an approach taught by Dominic O'Brien. I make one journey/loci for each key number, 0-6 and then store the years in that path, so the years that have a key of 0 will be stored in the 0's path.

A better way to calcuate the year key is the odd/11 formula. It's given on the doomsday algorithm wikipedia page

Finally I just want to say that altering the formula can give you the month, the year key, and even the date. I love working out how many friday the 13ths are in a given year.

Keep up the good work!

9:31 PM

The "“Dozens, remainder, and fours" approach was actually invented by Lewis Carroll. John Horton Conway copied it.