Calendar formula
here is the mathematical formula
d = (k + m - 2c + y + ydiv4 + cdiv4) mod 7, this formula is only applicable from March to December(both leap years and non leap years)
d = (k + m - 2c + y - 1 + ydiv4 + cdiv4) mod 7, this formula is only applicable from January and February(non leap years)
d = (k + m - 2c + y - 2 + ydiv4 + cdiv4) mod 7, this formula is only applicable from January and February(leap years)
legend:
d = day
k = date, 1,2...31
m = month
c = century, 18,19,20...
y = year, 85,86,98,08,...
day:
0 = Sunday
1 = Monday
2 = Tuesday
3 = Wednesday
4 = Thursday
5 = Friday
6 = Saturday
day: you will encounter negative days if you use the long method
0 = Sunday
-1 = Saturday
-2 = Friday
-3 = Thursday
-4 = Wednesday
-5 = Tuesday
-6 = Monday
month:
0 = January
3 = February
2 = March
5 = April
0 = May
3 = June
5 = July
1 = August
4 = September
6 = October
2 = November
4 = December
Leap Year Trivia
Some exceptions to this rule are required since the duration of a solar year is slightly less than 365.25 days. Years that are evenly divisible by 100 are not leap years, unless they are also evenly divisible by 400, in which case they are leap years.[ For example, 1600 and 2000 were leap years, but 1700, 1800 and 1900 were not in the 1582 papal bull (the 1750 British Calendar Act ignores 1700). Similarly, 2100, 2200, 2300, 2500, 2600, 2700, 2900, and 3000 will not be leap years, but 2400 and 2800 will be. By this rule, the average number of days per year will be 365 + 1/4 − 1/100 + 1/400 = 365.2425, which is 365 days, 5 hours, 49 minutes, and 12 seconds.
Interesting website:
http://www.dayofbirth.co.uk/
Link to this comment:
All Comments (0)