easter_dateGet Unix timestamp for midnight on Easter of a given year Description
int easter_date(intnull
$year = null , int $mode = CAL_EASTER_DEFAULT )Returns the Unix timestamp corresponding to midnight on Easter of the given year. The date of Easter Day was defined by the Council of Nicaea in AD325 as the Sunday after the first full moon which falls on or after the Spring Equinox. The Equinox is assumed to always fall on 21st March, so the calculation reduces to determining the date of the full moon and the date of the following Sunday. The algorithm used here was introduced around the year 532 by Dionysius Exiguus. Under the Julian Calendar (for years before 1753) a simple 19-year cycle is used to track the phases of the Moon. Under the Gregorian Calendar (for years after 1753 - devised by Clavius and Lilius, and introduced by Pope Gregory XIII in October 1582, and into Britain and its then colonies in September 1752) two correction factors are added to make the cycle more accurate. Parameters
Return ValuesThe easter date as a unix timestamp. Errors/ExceptionsA ValueError is thrown if the year is earlier than 1970 or later than 2037 when running on a 32-bit system, or later than 2,000,000,000 on a 64-bit system. Changelog
Examples
Example #1 easter_date example
Example #2 Using easter_date with DateTime
Notes
See Also
|