Click here to Skip to main content
Licence 
First Posted 7 Apr 2004
Views 45,506
Bookmarked 17 times

Computing Easter Date - VB Function

By | 15 Apr 2004 | Article
VB Function to Comput Easter Date

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>
 

License

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

About the Author

Jose Xavier

Web Developer

Portugal Portugal

Member



Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralMy vote of 5 PinmemberHeaven20209:28 3 Nov '10  
Generallittle bug Pinmemberiakivm5:13 26 Oct '09  
Question?????? PinmemberKandjar1:47 8 Apr '04  
AnswerRe: ?????? PinmemberJose Xavier5:46 15 Apr '04  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web04 | 2.5.120517.1 | Last Updated 16 Apr 2004
Article Copyright 2004 by Jose Xavier
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid