Calculate the day of any date
Do you want to know How to calculate the day of any given date off hand? Then read on.. For any given date, there is a simple workable formula to calculate the corresponding day. Since for most of the times we would work with dates in 20th and 21st century, So let me just limit myself to explain a simple formula that would work for these 200 years! Method : Given any date between 1900 to 2099, to calculate the corresponding day off the hand, we need to extract the following numbers. Legend: DD - day in the month MM - month CC - century YY - year in the century LY - no. of leap years past since beginning of century Given Date: DD MM CCYY LY - YY / 4 (last 2 digits of the year divided by 4) -> Quotient only Y - YY mod 7 (last 2 digits of the year's remainder with 7) L - LY mod 7 (no. of leap years in this century -> remainder with 7) M - value in the string ( 033 614 625 035 ) corresponding to month D - DD mod 7 (day in the month remainder with 7) C - 0 if CC = 20th century; ...