{"id":374,"date":"2014-01-02T03:51:00","date_gmt":"2014-01-02T03:51:00","guid":{"rendered":"http:\/\/www.lorenzcom.com\/?p=374"},"modified":"2020-12-03T07:28:26","modified_gmt":"2020-12-03T13:28:26","slug":"easter","status":"publish","type":"post","link":"https:\/\/lorenzcom.com\/?p=374","title":{"rendered":"Easter"},"content":{"rendered":"<h3>Easter ( theYear , method )<\/h3>\n<p>Easter custom function returns Julian, Orthodox, or Gregorian Easter dates for years 326 to 4000 (or 4099).<\/p>\n<p>Year validation changes the year to the minimum year that can be calculated for the calendar method. Validation can be commented out in this code, but dates less than the minimum may not be accurate.<\/p>\n<p>Easter for years 4001 to 4099 can be retrieved as text by un-commenting the code at the end of the function. Comment the subsequent FileMaker Date function line if you do this.<\/p>\n<h4>Parameters<\/h4>\n<ul>\n<li>theYear &#8211; the 4 digit year for which the date of Easter is requested.<\/li>\n<li>method &#8211; a number to indicate the calendar used to calculate the Easter date ( 1 = Julian, 2 = Orthodox, and 3 = Gregorian). Defaults to 3 if blank or out of range.<\/li>\n<\/ul>\n<h4>Examples<\/h4>\n<ul>\n<li>Easter ( 2012, 1 ) = 4\/2\/12<\/li>\n<li>Easter ( 2012, 2 ) = 4\/15\/12<\/li>\n<li>Easter ( 2012, 3 ) = 4\/8\/12<\/li>\n<\/ul>\n<hr \/>\n<h4>Method 1: ORIGINAL CALCULATION<\/h4>\n<p>From 326 AD, Easter Sunday was determined as the Sunday following the Paschal Full Moon (PFM) date for the year based on the Julian Calendar. PFM dates were made up of a simple cycle of 19 Julian calendar dates. This method returns a Julian calendar date, and applies for all years from 326 (The author&#8217;s last known use of the Julian calendar was in Greece in 1923).<\/p>\n<h4>Method 2: ORIGINAL CALCULATION converted to GREGORIAN CALENDAR<\/h4>\n<p>Same (original) calculation, also converts the Julian calendar date to the equivalent Gregorian calendar date. It applies for years 1583 to 4099. This method is currently used by Orthodox Churches.<\/p>\n<h4>Method 3: REVISED CALCULATION<\/h4>\n<p>This method calculates Easter Sunday as the Sunday following the Paschal Full Moon (PFM) date for the year based on the Gregorian Calendar. PFM dates are calculated from the relationship between the sun, moon &amp; earth (as understood in 1582) using many 19 Gregorian calendar date cycles. This method was adopted from 1583 in Europe, 1753 in England and is currently used by Western churches.<\/p>\n<p>Instrumental Gregorian calendar code enhancement by Phil Caulkin.<br \/>\nCode based on Ronald W. Mallen&#8217;s reasearch and Greg Mallen&#8217;s algorithm.<br \/>\nSee <a href=\"http:\/\/www.gmarts.org\/index.php?go=415\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/www.gmarts.org\/index.php?go=415<\/a>.<\/p>\n<p><strong>Easter code:<\/strong> Copy the selected code (click on Select All to highlight all the code) to the clipboard and paste it into a newly created Custom Function. <a href=\"\/docs\/FileMaker\/Easter.zip\">Download code as a text file from here.<\/a><\/p>\n<form><textarea id=\"&lt;?php\"> style=&#8221;width:100%; height:180px; font-family:Arial,Helvetica; font-size:.90em; line-height:normal;&#8221;&gt;&lt;!&#8211;raw&#8211;&gt;Let ( [&lt;br \/&gt;<br \/>\nx = GetAsNumber ( method ); x = If ( x &gt; 0 and x &lt; 4; x; 3 ); \/\/ Julian, Julian to Gregorian (Orthodox), Gregorian (default) method.<br \/>\ny = GetAsNumber ( theYear );<br \/>\ny = Case ( x = 1 and ( y &lt; 326 or y &gt; 4099 ); 326; x &gt; 1 and ( y &lt; 1583 or y &gt; 4099 ); 1583; y ); \/\/ Validate to minimum valid year for requested calendar, if out of range. Comment this line to remove validation.&lt;br \/&gt;<br \/>\nd = 0; m = 0; \/\/ Initialize day and month.&lt;br \/&gt;<br \/>\nfirstdig = Div ( y; 100 ); \/\/ First 2 digits of year (century).&lt;br \/&gt;<br \/>\nremain19 = Mod ( y ; 19 );&lt;\/p&gt;<br \/>\n&lt;p&gt;d = If ( x &lt; 3; \/\/ Method 1 or 2.<\/p>\n<p>Let ( [ \/\/ Calculate Paschal Full Moon (PFM) for Julian or Orthodox.<br \/>\ntA = Mod ( 225 &#8211; 11 * remain19; 30 ) + 21;<br \/>\n\/\/ Find the next Sunday<br \/>\ntB = Mod ( tA &#8211; 19; 7 );<br \/>\ntC = Mod ( 40 &#8211; firstdig; 7 );<br \/>\ntemp = Mod ( y; 100 );<br \/>\ntD = Mod ( temp + Div ( temp; 4 ); 7 );<br \/>\ntE = Mod ( 20 &#8211; tB &#8211; tC &#8211; tD; 7 ) + 1;<br \/>\nd = tA + tE;<br \/>\nd = If ( x = 2; \/\/ If Orthodox, convert Julian to Gregorian.<br \/>\nLet ( [ tmp = 10; tmp = If ( y &gt; 1600; tmp + firstdig &#8211; 16 &#8211; Div ( firstdig &#8211; 16; 4 ); tmp ) ]; d + tmp );&lt;br \/&gt;<br \/>\nd ) \/\/ End convert Julian to Gregorian.&lt;br \/&gt;<br \/>\n]; d ); \/\/ End of PFM calculation for Julian or Orthodox. &#8216;Let&#8217; returns d.&lt;\/p&gt;<br \/>\n&lt;p&gt;\/\/ Else, method 3.&lt;br \/&gt;<br \/>\nLet ( [ \/\/ Calculate PFM for Gregorian.&lt;br \/&gt;<br \/>\n\/\/ Phil Caulkin code:&lt;br \/&gt;<br \/>\ntemp = Div ( ( FirstDig &#8211; 15 ); 2 ) + 202 &#8211; 11 * Remain19;&lt;br \/&gt;<br \/>\n\/\/Note that for all years prior to 2100, you can just use Mod ( Temp ; 30 ) in place of this case function&lt;br \/&gt;<br \/>\ntemp2 = Case ( ValueCount ( FilterValues ( List ( 21; 24; 25; 27; 28; 29; 30; 31; 32; 34; 35; 38 ) ; FirstDig ) ); Mod ( temp &#8211; 1 ; 30 ); ValueCount ( FilterValues ( List ( 33; 36; 37; 39; 40 );  FirstDig ) ); Mod ( temp &#8211; 2 ; 30 ); Mod ( temp ; 30 ) );&lt;br \/&gt;<br \/>\ntA = temp2 + 21;&lt;br \/&gt;<br \/>\ntA2 = Case ( temp2 = 29; tA &#8211; 1; temp2 = 28 and Remain19 &gt; 10;  tA &#8211; 1; \/*else*\/ tA );&lt;br \/&gt;<br \/>\n\/\/Find the next Sunday&lt;br \/&gt;<br \/>\ntB = Mod ( tA2 &#8211; 19 ; 7 );&lt;br \/&gt;<br \/>\ntC = Mod ( 40 &#8211; FirstDig; 4 ) ;&lt;br \/&gt;<br \/>\ntC2 = Case ( tC = 3; tC + 2; \/*must be + 2 to match succeeding step that also increments by 1 in original algorithm*\/ tC &gt; 1; tC + 1; \/*else*\/ tc );&lt;br \/&gt;<br \/>\ntemp3 = Mod ( y; 100 );&lt;br \/&gt;<br \/>\ntD = Mod ( temp3 + Div ( temp3; 4 ); 7 );&lt;br \/&gt;<br \/>\ntE = Mod (20 &#8211; tB &#8211; tC2 &#8211; tD; 7 ) + 1;&lt;br \/&gt;<br \/>\nd = tA2 + tE \/\/ Day of month but not yet adjusted for values greater than 31&lt;br \/&gt;<br \/>\n\/\/End Phil Caulkin&#8217;s enhanced code.&lt;br \/&gt;<br \/>\n]; d ) \/\/ End of PFM calculation for Gregorian. &#8216;Let&#8217; returns d.&lt;br \/&gt;<br \/>\n); \/\/ End of assigning d to Julian, Orthodox, or Gregorian Easter number.&lt;\/p&gt;<br \/>\n&lt;p&gt;\/\/ Adjust month and day.&lt;br \/&gt;<br \/>\nm = Case ( d &gt; 61; 5; d &gt; 31; 4; 3 );&lt;br \/&gt;<br \/>\nd = Case ( d &gt; 61; d &#8211; 61; d &gt; 31; d &#8211; 31; d )&lt;br \/&gt;<br \/>\n];&lt;\/p&gt;<br \/>\n&lt;p&gt;\/\/GetAsText ( m ) &amp; &#8220;\/&#8221; &amp; GetAsText ( d ) &amp; &#8220;\/&#8221; &amp; GetAsText ( y ) \/\/ Un-comment to get years 1 to 4099.&lt;br \/&gt;<br \/>\nDate ( m; d; y ) \/\/ FileMaker Date returns years 1 to 4000. Comment to get years 1 to 4099.&lt;\/p&gt;<br \/>\n&lt;p&gt;)&lt;\/p&gt;<br \/>\n&lt;p&gt;\/*&lt;br \/&gt;<br \/>\nEaster ( theYear, method )&lt;\/p&gt;<br \/>\n&lt;p&gt;By Lewis Lorenz&lt;br \/&gt;<br \/>\nCreated 4\/5\/2012.&lt;br \/&gt;<br \/>\nUpdated 8\/1\/2012.&lt;\/p&gt;<br \/>\n&lt;p&gt;Returns Julian, Orthodox, or Gregorian Easter dates for years 326 to 4000 (or 4099).&lt;\/p&gt;<br \/>\n&lt;p&gt;theYear = the 4 digit year for which the date of Easter is requested.&lt;br \/&gt;<br \/>\nmethod = a number to indicate the calendar used to calculate the Easter date ( 1 = Julian, 2 = Orthodox, and 3 = Gregorian). Defaults to 3 if blank or out of range.&lt;\/p&gt;<br \/>\n&lt;p&gt;Year validation changes the year to the minimum year that can be calculated for the calendar method. Validation can be commented out in this code, but dates less than the minimum may not be accurate. Easter for years 4001 to 4099 can be retrieved as text by un-commenting the code at the end of the function. Comment the next &#8216;FileMaker Date&#8217; function line if you do this.&lt;\/p&gt;<br \/>\n&lt;p&gt;Instrumental Gregorian calendar code enhancement by Phil Caulkin.&lt;br \/&gt;<br \/>\nCode based on Ronald W. Mallen&#8217;s reasearch and Greg Mallen&#8217;s algorithm.&lt;br \/&gt;<br \/>\nSee http:\/\/www.gmarts.org\/index.php?go=415.&lt;\/p&gt;<br \/>\n&lt;p&gt;Method 1: ORIGINAL CALCULATION&lt;br \/&gt;<br \/>\nFrom 326 AD, Easter Sunday was determined as the Sunday following the Paschal Full Moon (PFM) date for the year based on the Julian Calendar.  PFM dates were made up of a simple cycle of 19 Julian calendar dates.&lt;br \/&gt;<br \/>\nThis method returns a Julian calendar date, and applies for all years from 326 (The author&#8217;s last known use of the Julian calendar was in Greece in 1923).&lt;\/p&gt;<br \/>\n&lt;p&gt;Method 2: ORIGINAL CALCULATION converted to GREGORIAN CALENDAR&lt;br \/&gt;<br \/>\nSame (original) calculation, also converts the Julian calendar date to the equivalent Gregorian calendar date. It applies for years 1583 to 4099.&lt;br \/&gt;<br \/>\nThis method is currently used by Orthodox Churches.&lt;\/p&gt;<br \/>\n&lt;p&gt;Method 3: REVISED CALCULATION&lt;br \/&gt;<br \/>\nThis method calculates Easter Sunday as the Sunday following the Paschal Full Moon (PFM) date for the year based on the Gregorian Calendar.  PFM dates are calculated from the relationship between the sun, moon &amp; earth (as understood in 1582) using many 19 Gregorian calendar date cycles.&lt;br \/&gt;<br \/>\nThis method was adopted from 1583 in Europe, 1753 in England and is currently used by Western churches.*\/&lt;!&#8211;\/raw&#8211;&gt;<\/textarea><br \/>\n<input form=\"\" type=\"text\" \/> type=&#8221;button&#8221; value=&#8221;Select All&#8221; \/&gt; <input type=\"reset\" value=\"Reset\" \/><\/form><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Easter ( theYear , method ) Easter custom function returns Julian, Orthodox, or Gregorian Easter dates for years 326 to 4000 (or 4099). Year validation changes the year to the minimum year that can be calculated for the calendar method. <span class=\"excerpt-dots\">&hellip;<\/span> <a class=\"more-link\" href=\"https:\/\/lorenzcom.com\/?p=374\"><span class=\"more-msg\">Continue reading &rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[10,15,14],"tags":[],"_links":{"self":[{"href":"https:\/\/lorenzcom.com\/index.php?rest_route=\/wp\/v2\/posts\/374"}],"collection":[{"href":"https:\/\/lorenzcom.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lorenzcom.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lorenzcom.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lorenzcom.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=374"}],"version-history":[{"count":25,"href":"https:\/\/lorenzcom.com\/index.php?rest_route=\/wp\/v2\/posts\/374\/revisions"}],"predecessor-version":[{"id":876,"href":"https:\/\/lorenzcom.com\/index.php?rest_route=\/wp\/v2\/posts\/374\/revisions\/876"}],"wp:attachment":[{"href":"https:\/\/lorenzcom.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=374"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lorenzcom.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=374"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lorenzcom.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=374"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}