User:The Monster/Perpetual Calendar

A perpetual calendar (or forever calendar) is a calendar which is good for a span of many years, such as the Runic calendar.

General information
For the Gregorian calendar, a perpetual calendar often consists of 14 one-year calendars, plus a legend to show which one-year calendar is to be used for any given year. Note that such a perpetual calendar fails to indicate the dates of moveable feasts such as Easter.

The 14 one-year calendars consists of two sets of seven calendars, seven for each common year (year that does not have a February 29) that starts on each day of the week, and seven for each leap year that starts on each day of the week, totaling fourteen.

Also certain calendar reforms may be considered to be inherently perpetual calendars, such as The World Calendar, International Fixed Calendar and Pax Calendar. These calendars have each year and each month within the year, always beginning on the same day of the week.

The term perpetual calendar is also used in watchmaking to describe a calendar mechanism in a watch that displays the date correctly 'perpetually', taking into account the different lengths of the months as well as leap year's day. The internal mechanism will move the dial to the next day.

Perpetual calendar formula
Following is a formula for calculating the day of the week given the date.

The formula uses the fact that each year begins one day later than the previous except for leap years. The days in a leap year are 2 days later except for January and February where it is one day later. Since the year values increase by one we can create a sequence by adding the year to the year divided by 4 dropping the fraction. This sequence increases by 1 every year except every 4 years where it increases by 2. This sequence will work for the years 1901 through 2099 only since 1900 and 2100 are not leap years.

A table is needed to get the relative day of week of the first of each month relative to the first day of a year.

Now for the formula (example for 2006-02-15).

Add the following: The 4 digit year (2006). The integer portion of the year divided by 4 (501). The relative month code (3). The day of the month (15). If it is a leap year and January or February then subtract 1. Adjust the relative week day by subtracting 1 (2525-1). Divide by 7 keeping the remainder (4).

Use this number to find the day as follows: Thus, February 15, 2006 is a Wednesday.

Alternate version
A Perpetual Calendar formula for finding the day of the week for any given year.

1. Begin with the century:

Following centuries continue the cyclic sequence.

2. The year: Take the last two figures of the year date and 1/4 of the number formed by them, ignoring the remainder. For example, for the year 1963, 63 divided by 4 is 15 with remainder 3. So, 63 plus 15 totals 78.

3. The month: For the month number, add as follows, except in case of January and February during a leap year.

The Leap Year Rule: a) If the year is divisible by 4 but not 100. b) If the year is divisible by 400.

4. Add the day number.

5. The total is divided by 7 and the remainder will be the day of the week, Sunday being the first day.

Example 1: September 11, 2001

Step 1. 2000s corresponds to                     0

Step 2. 01 plus 1/4 of 01 is                     1

Step 3. September corresponds to number          5

Step 4. The day of the month                    11

Step 5. The sum of 17 divided by 7 leaves 3 remainder. Number 3 corresponds to Tuesday.

Example 2: December 7, 1941

1. 1900s corresponds to 1

2. 41 plus 10 is 51

3. Dec corresponds to 5

4. The 7th day, add   7

5. Sum of 64 divided by 7 is 9 with 1 remainder. The first day of the week is SUNDAY.

This algorithm is presented as a single table in the following section, along with the necessary adjustments for Julian dates.

Perpetual Julian and Gregorian calendar table
For Julian dates before 1300 and after 1999 use the year in the table which differs by an exact multiple of 700 years. For Gregorian dates after 2299 use the year in the table which differs by an exact multiple of 400 years. The values " r0 " through " r6 " indicate the remainder when the Hundreds value is divided by 7 and 4 respectively, indicating how the series extend in either direction. Both Julian and Gregorian values are shown 1500-1999 for convenience.

Add together the numbers in the far right hand column on the same line as the hundreds, remaining digits and month. Add the day of the month to the total and divide the grand total by 7. Find the remainder from this division in the far right hand column. The day of the week is beside it. Bold figures (e.g. 04) denote leap year. If a year ends in 00 and its hundreds are in bold it is a leap year. Thus 19 indicates that 1900 is not a Gregorian leap year, (but 19 in the Julian column indicates that it is a Julian leap year, as are all Julian x00 years). 20 indicates that 2000 is a leap year. Use Jan and Feb only in leap years.

Example: On what day does Feb 3, 45 67 (Gregorian) fall? 1) The remainder of 45 / 4 is 1, so use the r1 entry: 5.

2) The remaining digits 67 give 6.

3) Feb (not Feb for leap years) gives 3.

4) Finally, add the day of the month: 3.

5) Adding 5 + 6 + 3 + 3 = 17. Dividing by 7 leaves a remainder of 3, so the day of the week is Tuesday.