The Doomsday rule or Doomsday algorithm is a way of calculating the day of the week of a given date. It provides a perpetual calendar since the Gregorian calendar moves in cycles of 400 years.The algorithm for mental calculation was invented by John Conway. It takes advantage of the fact that within any calendar year, the days of 4/4, 6/6, 8/8, 10/10, 12/12, and the last day of February always occur on the same day of week - the so-called "doomsday" (and furthermore that other months have "doomsday" on easy to remember pairs 5/9 and 9/5 as well as 7/11 and 11/7). This applies to both the Gregorian calendarA.D. and the Julian calendar, but note that for the Julian calendar the Doomsday of a year is a weekday that is usually different from that for the Gregorian calendar.
See more at Wikipedia.org...