First method

Let Sunday be $ 1$, Monday be $ 2$, ..., Saturday be $ 7$.

  1. Divide the last 2 digits of the year by $ 4$ and discard the fraction, call it $ a_1$.
  2. Add the date of the month to $ a_1$, call the result $ a_2$.
  3. Add to $ a_2$ the month's key value as given by the table below and call the result $ a_3$.
    Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
    1 4 4 0 2 5 0 3 6 1 4 6

  4. Subtract $ 1$ from $ a_3$ if the month is a Jan or Feb of a leap year. Call the result $ a_4$.
  5. To $ a_4$, add

    $\displaystyle \left\{
\begin{tabular}{cc}
0,& if the year was in the $1900$'s,\...
... in the $1700$'s,\\
2,& if the year was in the $1800$'s,
\end{tabular}\right.
$

    and if the year is not above then add a multiple of $ 400$ to convert to one of the above cases. Call the result $ a_5$.
  6. Add last 2 digits of the year to $ a_5$ and call the result $ a_6$.
  7. Let $ 1\leq a_7\leq 7$ satisfy $ a_6\equiv a_7\, ({\rm mod}\ 7)$.
This is the desired day of the week.

Notation: Let $ [x]$ denote the integer part of a real number $ x$.

Example 1.7.28   Find the day of the week of $ 9-14-99$ using the above algorithm.

(1) $ [99/4]=24$, (2) $ 24+14=38$, (3) $ 38+6=44$, (4) $ 44+0=44$, (5) $ 44+99=143$, (6) $ 143\equiv 3\ ({\rm mod}\ 7)$.

The third day is Tuesday.



David Joyner 2007-09-03