desired period 5. To go from the March 1 based ordinal day to a January 1 based ordinal day: For (March through December), where is a function returning 0 or 1 depending whether the input is a leap year. For January and February, two methods can be used: The trivial method is to skip the calculation of and go straight for for January and for February. The less redundant method is to use , where 306 is the number of dates in March through December. This makes use of the fact that the formula correctly gives a month-length of 31 for January. "Doomsday" properties: For and we get giving consecutive differences of 63 (9 weeks) for 3, 4, 5, and 6, i.e., between 4/4, 6/6, 8/8, 10/10, and 12/12. For and we get and with m and d interchanged giving a difference of 119 (17 weeks) for (difference between 5/9 and 9/5), and also for (difference between 7/11 and 11/7). Table For example, the ordinal date of April 15 is in a common year, and in a leap year. Month–day The number of the month and date is given by the term can also be replaced by with the ordinal date. Day 100 of a common year: April 10. Day 200 of a common year: July 19. Day 300 of a leap year: November - 5 = October 26 (31 - 5). See also Julian day Zeller's congruence ISO week date References Calendars Ordinal numbers