Introduction
Wen i start to work with the calendar control i felt the necessity to obtain the Ester Date to compute the other 2 moving Holy-Days, The Ash Wednesday -47 Days and corpus christy + 60 Days in order to mark that days in the calendar as holy-Days.
So i surf the net to study the problem and i found this url's:
http://aa.usno.navy.mil/faq/docs/easter.html
http://www.erlandsendata.no/english/functions/date/easter.php
With that it was easy to convert that to this function that receiving the year returns the ester date:
In VB:
Function F_easter_date(Year_of_easter as integer)<BR> Dim y as integer = Year_of_easter<BR> Dim d As Integer = (((255 - 11 * (y Mod 19)) - 21) Mod 30) + 21<BR> Dim easter_date = New DateTime(y, 3, 1)<BR>easter_date = easter_date.AddDays(+ d + (d > 48) + 6 - ((y + y \ 4 + d + (d > 48) + 1) Mod 7))<BR> return(easter_date)<BR> End function<BR>
Then:
Sub ex()<BR>Dim Date_AshWednesday as DateTime = easter_date("str_Year").AddDays(-47)<BR>Dim Date_CorpusChristy as DateTime = easter_date("str_Year").AddDays(60)<BR>End Sub
In Excel:
=FLOOR(DAY(MINUTE(A1/38)/2+56)&"/5/"&A1;7)-34<BR>
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here