I 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!
Basics
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
(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
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
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!
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.