CodeCogs - An iteractive open source Numerical library Welcome... Login
CodeCogs
shopping cart
OSXWindowsLinux
Search CodeCogs
Numerical Components

Valid RSS

UnitsDate

easter Sunday

Available under GPL (Free) and Commercial licence
get a GPL licence
COST (GBP)
this unit 2.60
sub units 5.20
add a commercial licence to your cart
0
viewed 4052 times and licensed 20 times

Calculates the date of Easter Sunday for the given year. Open Office: EASTERSUNDAY

Further Info Controller: CodeCogs  Contact Controller
+View version details
Contents hide toc
buy now     get GPL     add to cart

Group Description

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:
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

Interface

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

using namespace Units::Date;

int easterSunday (int year)[inline]
Calculates the date of Easter Sunday returning a serial Julian date.
ExcelInteger cc_easterSunday (Integer year)
This function is available as a Microsoft Excel add-in.
std::string easterSunday_str (int year)
Returns a date of Easter Sunday as a character string
ExcelString cc_easterSunday_str (Integer year)
This function is available as a Microsoft Excel add-in.

Function Documentation

Easter Sunday Calculator
  
Add calculator to website or email
 
inteasterSundayintyear )[inline]
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
Parameters:
yearthe year to compute easter for
Returns:
the serial Julian date (see date)
Authors:
Will Bateman (Oct 2004)
Source Code:

To view or download source code you need either a GPL or Commercial Licence.

buy now     get GPL     add to cart

Not a member, then Register with CodeCogs. Already a Member, then Login.


Easter Sunday Str Calculator
  
Add calculator to website or email
 
std::stringeasterSunday_strintyear )
Returns the date of Easter in a string format with day followed by month for the year specified.
Example 2:
int main(void)
{
  for(int year=2004; year<=2014; year++)
  {
    printf("\n%s",Units::Date::easterSunday_str(year).c_str());
  }
}
Note:
Parameters:
yearthe year to compute easter for
Returns:
a string containing the date
Source Code:

To view or download source code you need either a GPL or Commercial Licence.

buy now     get GPL     add to cart

Not a member, then Register with CodeCogs. Already a Member, then Login.


Page Comments

Format Excel Equations

  You must login to leave a messge


Last Modified: 10 Feb 08 @ 17:30     Page Rendered: 2010-03-11 04:05:35

Valid CSS!   Valid XHTML 1.0 Transitional