Editing Ordinal date
Appearance
Latest revision | Your text | ||
Line 34: | Line 34: | ||
The table of month lengths can be replaced following the method of encoding the month-length variation in [[Zeller's congruence]]. As in Zeller, the {{mvar|m}} is changed to {{math|''m'' + 12}} if {{math| ''m'' ≤ 2}}. It can be shown (see below) that for a month-number {{mvar|m}}, the total days of the preceding months is equal to {{math|⌊(153 * (''m'' − 3) + 2) / 5⌋}}. As a result, the March 1-based ordinal day number is {{math|1=''O''<sub>Mar</sub> = ⌊(153 × (''m'' − 3) + 2) / 5⌋ + ''d''}}. |
The table of month lengths can be replaced following the method of encoding the month-length variation in [[Zeller's congruence]]. As in Zeller, the {{mvar|m}} is changed to {{math|''m'' + 12}} if {{math| ''m'' ≤ 2}}. It can be shown (see below) that for a month-number {{mvar|m}}, the total days of the preceding months is equal to {{math|⌊(153 * (''m'' − 3) + 2) / 5⌋}}. As a result, the March 1-based ordinal day number is {{math|1=''O''<sub>Mar</sub> = ⌊(153 × (''m'' − 3) + 2) / 5⌋ + ''d''}}. |
||
The formula reflects the fact that any five consecutive months in the range March–January have a total length of 153 days, due to a fixed pattern 31–30–31–30–31 repeating itself twice. This is similar to encoding of the month offset (which would be the same sequence modulo 7) in Zeller's congruence. As {{sfrac|153|5}} is 30.6, the sequence oscillates in the desired pattern with the desired period 5. |
The formula reflects the fact that any five consecutive months in the range March–January have a total length of 153 days, due to a fixed pattern 31–30–31–30–31 repeating itself twice. This is similar to encoding of the month offset (which would be the same sequence modulo 7) in [[Zeller's congruence]]. As {{sfrac|153|5}} is 30.6, the sequence oscillates in the desired pattern with the desired period 5. |
||
To go from the March 1 based ordinal day to a January 1 based ordinal day: |
To go from the March 1 based ordinal day to a January 1 based ordinal day: |