Easter is a rather tricky beast to calculate. It is usually the first Sunday after the fourteenth day after the first new moon after the Vernal Equinox (March 21st). Quite a mouthful that.
There have been numerous ways worked out to find the date. The method listed below is an adaptation of the method appearing in Butcher’s Ecclesiastical Calendar in 1876. It works for the Gregorian calendar, so cannot be used to find dates before 1583.
public static DateTime CalcEasterDate(int piYear) { DateTime dEaster = new DateTime(); double iA; double iB; double iC; double iD; double iE; double iFA; double iG; double iH; double iK; double iI; double iL; double iM; double iNA; double iP; iA = (piYear % 19); iB = Math.Floor(piYear / 100.0); iC = (piYear % 100); iD = Math.Floor(iB / 4.0); iE = (iB % 4); iFA = Math.Floor((iB +8) / 25.0); iG = Math.Floor((iB - iFA + 1) / 3); iH = ((19 * iA) + iB - iD - iG + 15) % 30; iI = Math.Floor(iC / 4.0); iK = (iC % 4); iL = (32 + (2 * iE) + (2 * iI) - iH - iK) % 7; iM = Math.Floor((iA + (11 * iH) + (22 * iL)) / 451.0); iNA = Math.Floor((iH + iL - (7 * iM) + 114) / 31.0); iP = (iH + iL - (7 * iM) + 114) % 31; dEaster = new DateTime(piYear, Convert.ToInt16(iNA), Convert.ToInt16(iP + 1)); return dEaster; }
Comments