Returns a date of Easter Sunday as a character string
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>usingnamespace 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);
}return0;
}
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
Calculates the date of Easter Sunday in the specified Year, returning the serial Julian date (see date).
The calculation of the Day and Month for Easter Sunday that falls within the specified Year (for the Gregorian calendar) is performed using the equations:
References:
Tondering, C. 2003. www.tondering.dk/claus/cal/node3.html