# Thread: Procedure to calculate the day of the week for a given date.

1. ## Procedure to calculate the day of the week for a given date.

To calculate the day of the week for a given date, first of all we need to find out the number of odd days.

Today I thought of sharing a beautiful problem I learned in my school, though it is easy, it is tricky too.
Odd Days are number of days more than the complete number of weeks in given period.
Leap Year is the year which is divisible by 4.
A normal year has 365 days
A leap year has 366 days
One normal year = 365 days = 52weeks + 1day
One normal year has one odd day

One leap year = 366 days = 52weeks + 2days
One leap year has two odd days

100 years = 76 ordinary years + 24 leap years = 5200 weeks + 124 days = 5217 weeks + 5 days
100 years have 5 odd days

400 years have (20+1) 0 odd days

The number of odd days and the corresponding day of the week is given below

0-Sunday
1-Monday
2-Tuesday
3-Wednesday
4-Thursday
5-Friday
6-Saturday

So by finding out the number of odd days you can find out the day of the week. I hope this procedure Will be helpful in solving math problems in exams.

Thanks.

2. ## Re: Procedure to calculate the day of the week for a given date.

I follow your logic up to this: "The number of odd days and the corresponding day of the week is given below." I think what you mean is the number of "odd" days tells you how many weekdays ahead you have to jump ahead from a known day of the week. For example, today is Monday July 28, so July 28 in the year 2114 is Monday + 5 = Saturday. One other issue - you have compensated for the fact that years divisible by 100 are not leap years, but don't forget that years divisible by 400 are in fact leap years. Hence the year 1900 was not a leap year but the year 2000 was. So in calculating the date for the year 2400-2799 you need to add one more "odd" day.

3. ## Re: Procedure to calculate the day of the week for a given date.

I agree with your point that is why i added extra 1 odd day for 400 years.