Calculates the date of Easter Sunday for the given year. <span align="right" style="background-color:9999FF"><strong>Open Office: EASTERSUNDAY</strong></span>

View versions (1)

Interface

#include <codecogs/units/date/eastersunday.h>

using namespace Units::Date;

Overview

This component calculates the date of Easter Sunday for a specified Year. Two functions are presented: The first returns a serial number, equivalent to that which you find in Excel, with represents the date of Easter Sunday. The second converts this value into a human readable form (a string!).

Many other important dates (holidays!) can also be calculated from this function, for example:

  • Septuagesima Sunday = easterSunday(...) -63
  • Sexagesima Sunday = easterSunday(...) -56
  • Shrove Sunday = easterSunday(...) -49
  • Shrove Tuesday = easterSunday(...) -47
  • Ash Wednesday = easterSunday(...) -46
  • Mothers Day (UK only)= easterSunday(...) -21
  • Passion Sunday = easterSunday(...) -14
  • Palm Sunday = easterSunday(...) -7
  • Holy or Maundy Thursday = easterSunday(...) -3
  • Good Friday = easterSunday(...) -2
  • Rogation Sunday = easterSunday(...) +35
  • Ascension Day = easterSunday(...) +39
  • Pentecost or Whitsunday = easterSunday(...) +49
  • Whitmundy = easterSunday(...) +50
  • Trinity Sunday = easterSunday(...) +56
  • Corpus Christi = easterSunday(...) +60 (or easterSunday(...)+63 Catholic Church in the United States)

Example 1

To calculate the date of Good Friday for the next 10 years

#include <stdio.h>
#include <codecogs/units/date/eastersunday.h>
#include <codecogs/units/date/dateymd.h>
using namespace Units::Date;

int main()
{
  for(int year=2004; year<=2014; year++)
  {
    int ndate=easterSunday(year) - 2;
    int d,m,y;
    dateYMD(ndate, y, m, d);
    printf("\n In year %d, Good Friday is on %d/%d", y, d, m);
  }
  return 0;
}

Output:

In year 2004, Good Friday is on 9/4
In year 2005, Good Friday is on 25/3
In year 2006, Good Friday is on 14/4
In year 2007, Good Friday is on 6/4
In year 2008, Good Friday is on 21/3
In year 2009, Good Friday is on 10/4
In year 2010, Good Friday is on 2/4
In year 2011, Good Friday is on 22/4
In year 2012, Good Friday is on 6/4
In year 2013, Good Friday is on 29/3
In year 2014, Good Friday is on 18/4
GPL Licence — free for non commercial use. See Licence details.

FUNCTION

easterSunday

Calculates the date of Easter Sunday in the specified Year, returning the serial Julian date (see date).

This part is only visible to registered users. Sign in to see it.

References

Tondering, C. 2003. www.tondering.dk/claus/cal/node3.html

Parameters

year
the year to compute easter for

Returns

the serial Julian date (see date)
Author

Will Bateman (Oct 2004)

Interactive Calculator

year
Result

FUNCTION

easterSunday_str

Returns the date of Easter in a string format with day followed by month for the year specified.

Example 1

int main(void)
{
  for(int year=2004; year<=2014; year++)
  {
    printf("\n%s",Units::Date::easterSunday_str(year).c_str());
  }
}

Parameters

year
the year to compute easter for

Returns

a string containing the date

Interactive Calculator

year
Result