How to Calculate Easter (just what you always wanted)
- From: mr_unreliable <kindlyReplyToNewsgroup@xxxxxxxxxxx>
- Date: Fri, 08 Feb 2008 16:35:24 -0500
hi Group,
Most "serious date calculations" have to deal with what really
matters, for example the excel calculation of the usual
business holidays.
However, since Easter is coming unusually early this year, and
seems to arrive at an arbitrary date each year, I wondered if
there was a way to calculate that. Google turns up this:
http://www.smart.net/~mmontes/nature1876.html
And it seems to work. Here is the code (beware wordwrap):
--- <code> ---
' ------------------------------------------------
' Easter in the Gregorian Calendar
' ------------------------------------------------
' Originally published 1996 December by M.J. Montes.
' This page was last updated 2001 July 31 by Marcos J. Montes.
' The actual origin of this algorithm appears to be by an
' anonymous correspondent from New York to Nature in 1876
' (Thanks Denis!). Samuel Butcher, Bishop of Meath, showed
' that this algorithm followed from Delambre's analytical
' solutions, and produces the date of Easter for all years.
' You can see the algorithm, as well as version for Orthodox
' Easter at another Easter Date site.
' This algorithm appears in Practical Astronomy With Your
' Calculator, 2nd Edition by Peter Duffett-Smith, and he
' obtained this algorithm from Butcher's Ecclesiastical
' Calendar, published in 1876. This algorithm has also been
' published in the 1922 book General Astronomy by Spencer
' Jones; in The Journal of the British Astronomical Association
' (Vol.88, page 91, December 1977); and in Astronomical
' Algorithms (1991) by Jean Meeus.
' This algorithm holds for any year in the Gregorian Calendar,
' which (of course) means years including and after 1583.
' In the text below, / represents an integer division neglecting
' the remainder, while % is division keeping only the remainder.
' So 30/7=4 , and 30%7=2 .
' a=year%19
' b=year/100
' c=year%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
' Easter Month =(h+l-7*m+114)/31 [3=March, 4=April]
' p=(h+l-7*m+114)%31
' Easter Date=p+1 (date in Easter Month)
' === Script Calculation begins Here =============
Dim vA, vB, vC, vD, vE, vF, vG, vH, vI, vK, vL, vM, vEasterMonth, vP, vEasterDay
Dim sYear, vYear
Const sCaption = "Easter Calculation Script"
Do
sYear = InputBox("Enter Year in the range 1900 < Yr < 2100:", sCaption)
' MsgBox ("You entered: " & CStr(sYear))
vYear = CLng(sYear)
' note: this algorithm is advertised as being "good-for-any-year-
' after-1583", but just to make sure the user is serious, check for
' a date in the last century or this one before proceeding...
Loop Until ((vYear > 1900) AND (vYear < 2100))
vA = vYear Mod 19 ' remainder
vB = vYear \ 100 ' integer part
vC = vYear Mod 100
vD = vB \ 4
vE = vB Mod 4
vF = (vB + 8) \ 25
vG = (vB - vF + 1) \ 3
vH = (19*vA + vB - vD - vG + 15) Mod 30
vI = vC \ 4
vK = vC Mod 4
vL = (32 + 2*vE + 2*vI - vH - vK) Mod 7
vM = (vA + 11*vH + 22*vI) \ 451
vEasterMonth = (vH + vL - 7*vM + 114) \ 31
vP = (vH + vL - 7*vM + 114) Mod 31
vEasterDay = vP + 1
MsgBox "Easter Month/Day/Year: " & CStr(vEasterMonth) _
& "/" & CStr(vEasterDay) & "/" & sYear, vbInformation, sCaption
WScript.Quit
--- </code> ---
cheers, jw
Note: it has always puzzled me that Jesus has the same birthday
every year (Dec 25th), but dies on a DIFFERENT day every year.
I suppose that is just something that one is expected to accept
as an act of faith.
.
- Follow-Ups:
- Re: How to Calculate Easter (just what you always wanted)
- From: Dr J R Stockton
- Re: How to Calculate Easter (just what you always wanted)
- From: Dr J R Stockton
- Re: How to Calculate Easter (just what you always wanted)
- Prev by Date: Re: HTA_HelpOMatic
- Next by Date: Re: vbscript to save file to a folder under user profile
- Previous by thread: Re: HTA_HelpOMatic
- Next by thread: Re: How to Calculate Easter (just what you always wanted)
- Index(es):
Relevant Pages
|