next up previous
Next: Magic numbers Up: How to guess the Previous: Algorithm

Examples

Let us derive the day of the week for Sep. 15, 1990. The values of the variables are

The day of the year 1990 is given by

The day of the week is calculated by

Therefore, Sep. 15, 1990 is Saturday.

If your year was leap year and your month was after February as Dec. 25, 1994, you need to increment the day in the final equation (7). The values of the variables are

as well. The day of the year 1964 is given by

The day of the week is calculated by

Therefore, Dec. 25, 1964 is Friday.


next up previous
Next: Magic numbers Up: How to guess the Previous: Algorithm

yoshi.tamori@gmail.com