Mirror

Good Thursday and Easter Date function (Views: 706)


Problem/Question/Abstract:

Here is another function that calculates the Good Thursday and any other related date for eny year. The algorithm provided here is straightforward in the sense that it calculates the Good Thursday (which is the jewish passover) as the thursday ocurring in the same week as the first spring full moon. Obviously the function can be easily adapted to calculate any full moon down to the second.

Answer:

function good_thursday(year: integer): tdatetime;
const
  full_moon: tdatetime = 34804.33889; {15/4/95 8:08}
  sunday: tdatetime = 1;
  sinodic_month: tdatetime = 29.53058912;

var
  equinoccio: tdatetime;
  lunar_months: double;
  full_moon, weeks: double;

begin
  if year < 100 then
    if year year := year + 2000
  else
    year := year + 1900;
  equinoccio := encodedate(year, 3, 21);
  lunar_months := 10000 - Int(10000 - (equinoccio - full_moon) / sinodic_month);
  full_moon := full_moon + sinodic_month * lunar_months;
  weeks := 10000 - Int(10000 - (full_moon - sunday) / 7);
  good_thursday := sunday + 7 * weeks - 3;
end;

<< Back to main page