DateUtilsEasterSunday Method
This method can be used to calculate the Easter Sunday date using one of three methods defined by
EasterMethod.
Namespace: EWSoftware.PDIAssembly: EWSoftware.PDI (in EWSoftware.PDI.dll) Version: 2023.1.2.0
public static DateTime EasterSunday(
int year,
EasterMethod method
)
Public Shared Function EasterSunday (
year As Integer,
method As EasterMethod
) As DateTime
public:
static DateTime EasterSunday(
int year,
EasterMethod method
)
static member EasterSunday :
year : int *
method : EasterMethod -> DateTime
- year Int32
- The year in which to calculate Easter
- method EasterMethod
- The method to use for calculating Easter
DateTimeThe date on which Easter falls in the specified year as calculated using the specified
method.
See the
EasterMethod enumerated type for the ways in which Easter Sunday can
be calculated. A number of days can be added to or subtracted from the returned date to find other
Easter related dates (i.e. subtract two from the returned date to get the date on which Good Friday
falls).
// Returns 04/11/2004 for Easter
dtEaster = DateUtils.EasterSunday(2004, EasterMethod.Gregorian);
// Calculate Good Friday from that date
dtGoodFriday = dtEaster.AddDays(-2);
' Returns 04/11/2004 for Easter
dtEaster = DateUtils.EasterSunday(2004, EasterMethod.Gregorian)
' Calculate Good Friday from that date
dtGoodFriday = dtEaster.AddDays(-2)
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
ArgumentOutOfRangeException | An exception is thrown if the year is not between 1583
and 4099 for the Orthodox and Gregorian methods or if the year is less than 326 for the Julian
method. |