Every used variable are integer type

  • If Month = 1 or Month = 2 then,
    • Month = Month+12
    • Year = Year-1
  • Weekday = ( Day + 2*Month + (6*(Month+1)) div 10 + Year + Year div 4 - Year div 100 + Year div 400 ) mod 7

Equivalence between the weekday and the day name

  • Weekday = day name
  • 0 = Monday
  • 1 = Tuesday
  • 2 = Wednesday
  • 3 = Thursday
  • 4 = Friday
  • 5 = Saturday
  • 6 = Sunday

Particularity : Every year, the 4/4 (April 4th), the 6/6 (June 6th), the 8/8 (August 8th), the 10/10 (October 10th) and the 12/12 (December 12th) come the same weekday.