PHP 5.6.0 released


(PHP 4, PHP 5)

easter_daysGet number of days after March 21 on which Easter falls for a given year


int easter_days ([ int $year = date("Y") [, int $method = CAL_EASTER_DEFAULT ]] )

Returns the number of days after March 21 on which Easter falls for a given year. If no year is specified, the current year is assumed.

This function can be used instead of easter_date() to calculate Easter for years which fall outside the range of Unix timestamps (i.e. before 1970 or after 2037).

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.



The year as a positive number. If omitted, defaults to the current year according to the local time.


Allows Easter dates to be calculated based on the Gregorian calendar during the years 1582 - 1752 when set to CAL_EASTER_ROMAN. See the calendar constants for more valid constants.

Valorile întoarse

The number of days after March 21st that the Easter Sunday is in the given year.


Example #1 easter_days() example


echo easter_days(1999);        // 14, i.e. April 4
echo easter_days(1492);        // 32, i.e. April 22
echo easter_days(1913);        //  2, i.e. March 23


Vedeți de asemenea

  • easter_date() - Get Unix timestamp for midnight on Easter of a given year

add a note add a note

User Contributed Notes 2 notes

ian at eiloart dot com-NOSPAM
12 years ago
Also, be aware that the eastern orthodox churches sometimes have different dates for easter. See, for example <>. And note that the dates of easter a subject to change,  for example, the churches might some day decide to unify the dates.
martin at diers dot cc
13 years ago
This function appears to be Britanno-centric. When attempting to calculate the Gregorian date for Easter for years prior to 1753, the function returns the number or days since March 21st in the Julian Calendar, even though the Gregorian system was in effect in the rest of Europe since 1582. If you wish to calculate the date of easter for a Gregorian date from 1582 onward, use the following function, which duplicates the funcionality of easter_days:

function easter_days2($year) {
#First calculate the date of easter using Delambre's algorithm.
$a = $year % 19;
$b = floor($year / 100);
$c = $year % 100;
$d = floor($b / 4);
$e = $b % 4;
$f = floor(($b + 8) / 25);
$g = floor(($b - $f + 1) / 3);
$h = (19 * $a + $b - $d - $g + 15) % 30;
$i = floor($c / 4);
$k = $c % 4;
$l = (32 + 2 * $e + 2 * $i - $h - $k) % 7;
$m = floor(($a + 11 * $h + 22 * $l) / 451);
$n = ($h + $l - 7 * $m + 114);
$month = floor($n / 31);
$day = $n % 31 + 1;

#Return the difference between the JulianDayCount for easter and March 21'st
        #of the same year, in order to duplicate the functionality of the easter_days function
return GregorianToJD($month, $day, $year) - GregorianToJD(3,21,$year);
To Top