Wednesday, July 10, 2013

Determination of the day of the week

Learn how to determine the day of the week by some simple calculations.

Before beginning the the process, you should be aware of the couple of factors :

a) Sun =1, Mon =2, Tue =3, Wed =4, Thu =5, Fri =6, Sat =0

b) Codes given to the months of the year.

Codes for 20th Century                          Codes for 21st Century   (!!!Subtract 1 from code of 20th c)                        
Jan:   1                                                        0
Feb:  4                                                        3
Mar:  4                                                        3
Apr:  0                                                        0
May: 2                                                        2
Jun:   5                                                        4
Jul:    0                                                        6
Aug:  3                                                        2
Sept: 6                                                        5
Oct:  1                                                        0
Nov: 4                                                        3
Dec: 6                                                        5

Example 1. OK, now lets work out an example, let the date be  17/07/1986

Steps:

  1. Write down the last two digit of the year -->   86
  2. Calculate the no. of leap year during this period -->  86/4 gives us 21 R 2. We only need the quotient part i.e 21.
  3. Write the code of the month, i.e code for July ---> 0
  4. Write down the date -->  17
  5. Sum all the value you have, that should be 86 + 21 + 0+ 17 = 124
  6. Now divide the sum by 7 (no. of days in a week) --> 124/7   = 17 R 5.
  7. Remainder is 5, so the day is Thursday.
Example 2. Let the date be 17/07/2013

Steps:

  1. Write down the last two digit of the year -->   13
  2. Calculate the no. of leap year during this period -->  13/4 gives us 3 R 1. We only need the quotient part i.e 3.
  3. Write the code of the month, i.e code for July ---> 6
  4. Write down the date -->  17
  5. Sum all the value you have, that should be 13 + 3 + 6+ 17 =39
  6. Now divide the sum by 7 (no. of days in a week) --> 39/7   = 5 R 4.
  7. Remainder part is 4, so the day is Wednesday.
So, basically now what we can do is to build an expression so that it is more easier to understand and remember.

Day = (Year + Year/4 + Date + MCode) / 7

Note: Value of the years should be the last two digit.

Wiki link for more details on the date conversion:

Hope this information helps you.