Skip to content

Instantly share code, notes, and snippets.

@entity1991
Last active March 31, 2024 21:20
Show Gist options
  • Save entity1991/c93add3f890c40eec0e8 to your computer and use it in GitHub Desktop.
Save entity1991/c93add3f890c40eec0e8 to your computer and use it in GitHub Desktop.
def self.easter(year)
y = year
a = y % 19
b = y / 100
c = y % 100
d = b / 4
e = b % 4
f = (b + 8) / 25
g = (b - f + 1) / 3
h = (19 * a + b - d - g + 15) % 30
i = c / 4
k = c % 4
l = (32 + 2 * e + 2 * i - h - k) % 7
m = (a + 11 * h + 22 * l) / 451
month = (h + l - 7 * m + 114) / 31
day = ((h + l - 7 * m + 114) % 31) + 1
Date.civil(year, month, day)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment