Output Easter dates for different years:
<?phpecho easter_date() . "<br />";echo date("MdY",easter_date()) . "<br />";echo date("MdY",easter_date(1975)) . "<br / >";echo date("MdY",easter_date(1998)) . "<br />";echo date("MdY",easter_date(2007));?>The easter_date() function returns the Unix timestamp of Easter midnight in the specified year.
Tip: The date of Easter is defined as the first Sunday after the full moon on the spring equinox (March 21) each year.
easter_date( year);
parameter | describe |
---|---|
year | Optional. Defines the year (between 1970 and 2037) used to calculate the Easter date. If omitted, the current year and local time are used by default. |
Return value: | Returns the Unix timestamp of the Easter date. |
---|---|
PHP version: | 4+ |
Update log: | In PHP 4.3, the year parameter is optional. |