## Easter date and Easter Monday date

Example scripts and tips (replaces Old Scripts & Tips archive)

Moderators: Dorian (MJT support), JRL, Phil Pendlebury

BAM
Newbie
Posts: 4
Joined: Fri Nov 24, 2017 6:56 pm

### Easter date and Easter Monday date

Here is a little SRT to calculate the Easter and the Easter Monday based on the year. It's use the Vbscript written by me vbs_PadString and you can find it below.

The results variables are:
pasqua_1 = Easter date
pasqua_2 = Easter Monday date

Return date are in dd/mm/yyyy format

/*

Calcola data pasqua e lunedì dell'Angelo in base all'anno

Var_1: (I) Anno

*/
SRT>get_EASTER_DATE
Let>anno=get_EASTER_DATE_Var_1

Let>nc={Int(%anno%/100)}
Let>nn={%anno%-19*(Int(%anno%/19))}
Let>nk={Int((%nc%-17)/25)}
Let>ni1={(%nc%-Int(%nc%/4)-Int((%nc%-%nk%)/3)+(19*%nn%)+15)}
Let>ni2={%ni1%-30*Int(%ni1%/30)}
Let>ni3={%ni2%-Int(%ni2%/28)*(1-Int(%ni2%/28)*Int(29/(%ni2%+1))*Int((21-%nn%)/11))}
Let>nj1={%anno%+Int(%anno%/4)+%ni3%+2-%nc%+Int(%nc%/4)}
Let>nj2={%nj1%-7*(Int(%nj1%/7))}
Let>nl={%ni3%-%nj2%}
Let>Pmese={3+Int((%nl%+40)/44)}
Let>Pgiorno={%nl%+28-31*Int(%Pmese%/4)}
IF>{(%Pmese%=3) AND (%Pgiorno%=31)}
Let>Lmese=4
Let>Lgiorno=1
else
Let>Lmese=%Pmese%
Let>Lgiorno={(%PGiorno%+1)}
ENDIF
Let>length=2
Let>pasqua_1=%Pgiorno%/%Pmese%/%anno%
Let>pasqua_2=%Lgiorno%/%Lmese%/%anno%

END>get_EASTER_DATE

VBSTART
' This function pads a string to a specified length
' pString - String to pad
' pLength - Required length
' pChar - Single character to use for padding
' If the string is already longer than pLength it will be truncated.
strString = pString