Monday, February 8, 2010

Easter / HotDocs knowledge base.

The HotDocs knowledge base seems to be in flux, probably because of the recent purchase of HotDocs so it is no longer a LexisNexis product. Nevertheless, there is still a lot of information out there, including strings of code for various functions. One of the more complicated is the calculation (below) to find the date of Easter in a given year.
I hope the knowledge base has been or will soon be set up elsewhere. However, you can still find lots of HotDocs information either elsewhere or by going to the Google cached versions of pages after you google them.

Easter (First Sunday after the Paschal Full Moon (PFM) date)

SET Century TO TRUNCATE( Year / 100, 0 )
SET Temp Var TO TRUNCATE( ( Century - 15) / 2, 0 ) + 202
SET Temp Var TO Temp Var - 11 * REMAINDER( Year, 19 )
IF Century = 21 OR Century = 24 OR Century = 25 OR ( Century >= 27 AND Century <= 32 ) OR Century = 34 OR Century = 35 OR Century = 38
SET Temp Var TO Temp Var - 1
ELSE IF Century = 33 OR Century = 36 OR Century = 37 OR Century = 39 OR Century = 40
SET Temp Var TO Temp Var - 2
END IF
SET Temp Var TO REMAINDER( Temp Var, 30 )
SET Full Moon TO Temp Var + 21
IF Temp Var = 29
SET Full Moon TO Full Moon - 1
END IF
IF Temp Var = 28 AND REMAINDER( Year, 19 ) > 10
SET Full Moon TO Full Moon - 1
END IF
IF Full Moon > 31
SET Full Moon TO Full Moon - 31
DATE OF( Full Moon, 4, Year ) + 1 DAY
ELSE
DATE OF( Full Moon, 3, Year ) + 1 DAY
END IF
IF DAY OF WEEK( RESULT ) != 1
RESULT + ( 8 - DAY OF WEEK( RESULT ) ) DAYS
END IF

No comments:

Post a Comment