Some time ago I was called about an online calendar for a company’s portal. The need was to inform employees about public holidays for the requested year. In Greece, some of those holidays are static meaning they occur the exact same date each year, but some are based on the Orthodox Easter so they move from date to date. There are a lot of online services that can return these information, but I thought I should give it a go and try writing the Orthodox Easter calculation in C#. Saying that, I found the algorithm online and since I was there I also found the Catholic Easter algorithm.
In this post you will find the calculation for the two Christianity events only, and in a later post I will also publish the public holidays calculation.
Have in mind that since the methods return
DateTime“every possible year” is not quite accurate! And besides, both algorithms have problems after year 4200. You can read more about it here: http://en.wikipedia.org/wiki/Computus
This is the Orthodox Easter calculation:
And this is for the Catholic Easter: