Display the Easter date for various years.
| <?php echo easter_date() . “<br />”; echo date(“M-d-Y”,easter_date()) . “<br />”; echo date(“M-d-Y”,easter_date(1975)) . “<br />”; echo date(“M-d-Y”,easter_date(1998)) . “<br />”; echo date(“M-d-Y”,easter_date(2007)); ?> |
The easter_date() function returns the Unix timestamp for midnight on Easter Sunday of a given year.
Tip: Easter Sunday is determined as the Sunday following the first full moon that occurs on or after the Spring Equinox (March 21st).
| easter_date(year); |
|
Parameter |
Description |
|
year |
(Optional) Specifies a year between 1970 and 2037. If not provided, the default is the current year based on local time. |
|
Return Value: |
Returns the Unix timestamp for the date of Easter. |
|
PHP Version: |
4+ |
|
Changelog: |
As of PHP 4.3, the year parameter became optional. |