How to Create a Gregorian Calendar With Algorithms
The Gregorian calendar is the main calendar used throughout most of today's world. The calendar derives from the Christian calendar of the Middle Ages and Renaissance, which in turn derived from the Roman civil calendar. Although the basis of the calendar still has a Christian context, the accuracy and durability of the Gregorian calendar has made it the system of choice. The calendar derives from a series of algorithms that relate Earth's days to the length of the year. Because the year is not an exact number of days, such relationships are somewhat complex and in need of mathematical help.
Instructions
-
-
1
Determine the leap years. The Gregorian calendar uses a system by which an extra day is added to the year every four years. This reflects the approximation of 365.25 days in one year.
-
2
Find leap years using the algorithm that L is a leap year if L/4 is a whole number.
-
-
3
Remove the leap year in century-change years (1900, 1800, etc.) unless that year is divisible by 400 (2000 was a leap year).
-
4
Modify the leap year determination by using the algorithm that L is a leap year if L/4 is a whole number and if L is a century-change year, L is a leap year only if L/400 is a whole number.
-
5
Find the day of the week in a year. Since there are 52 weeks (W) plus 1 day (D) in a year (Y), the day of the week moves ahead by one each year (two days in a leap year). This can be summarized as Y = 52 x W + 1.
-
6
Look for the repetition of days of the week over the years. Every 400 years, the Gregorian calendar cycle repeats completely, and this corresponds to an integral number of weeks: 400 (years) x 365 (days) + 97 (extra leap days) = 146,097 days; 146,097 (days) / 7 (days in a week) = 20,871 weeks in 400 years.
-
1
Tips & Warnings
You can follow more complex algorithms to find exact days of the week for any time on the Gregorian calendar. Just start with the nearest century-change year and perform the algorithms from that point. Even the Gregorian calendar is not perfect in its standard algorithms. For this reason, international agreement occasionally adds leap minutes and leap seconds to the calendar. Watch the news to find out when such additions may occur, as they do not follow the standard calendar algorithms.