Created
May 7, 2018 20:53
-
-
Save dgusoff/49ff58c1891c554fad2e1b9e19c871fc to your computer and use it in GitHub Desktop.
calculate the date of Easter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static DateTime Easter(int year) | |
{ | |
int a = year%19; | |
int b = year/100; | |
int c = (b - (b/4) - ((8*b + 13)/25) + (19*a) + 15)%30; | |
int d = c - (c/28)*(1 - (c/28)*(29/(c + 1))*((21 - a)/11)); | |
int e = d - ((year + (year/4) + d + 2 - b + (b/4))%7); | |
int month = 3 + ((e + 40)/44); | |
int day = e + 28 - (31*(month/4)); | |
return new DateTime(year, month , day); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment