### Get Easter Date for given Year

Calculates the date of Easter using the algorithm published in Butcher's Ecclesiastical Calendar
(1876). It is valid for all years in the Gregorian calendar (1583+).
' Get the Easter date in format yyyy-MM-dd
' Return String in format yyy-MM-dd, like 2014-04-20
`Sub getEasterDate(Year As Int) As String
Dim a As Int
Dim b As Int
Dim c As Int
Dim d As Int
Dim e As Int
Dim f As Int
Dim g As Int
Dim h As Int
Dim i As Int
Dim k As Int
Dim l As Int
Dim m As Int
Dim n As Int
Dim p As Int
If Year < 1583 Then Return
a = Year Mod 19
b = Year / 100
c = Year Mod 100
d = b / 4
e = b Mod 4
f = (b + 8) / 25
g = (b - f + 1) / 3
h = (19 * a + b - d - g + 15) Mod 30
i = c / 4
k = c Mod 4
l = (32 + 2 * e + 2 * i - h - k) Mod 7
m = (a + 11 * h + 22 * l) / 451
n = (h + l - 7 * m + 114) / 31
p = (h + l - 7 * m + 114) Mod 31
Return Year & "-" & NumberFormat(n, 2 ,0) & "-" & NumberFormat((p + 1), 2 ,0)
End Sub`

Changed: , Category: DateTime, File: T6C183M1328.htm, ID: 1328