Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PHP easter_date() Function

PHP easter_date() Function

PHP Calendar Reference Manual PHP Calendar Reference Manual

Example

Output the Easter date for different years:

"; echo date("M-d-Y",easter_date()) . "
"; echo date("M-d-Y",easter_date(1975)) . "
"; echo date("M-d-Y",easter_date(1998)) . "
"; echo date("M-d-Y",easter_date(2007)); ?>

Run Example »


Definition and Usage

The easter_date() function returns the Unix timestamp for midnight on Easter of the specified year.

**Tip:** The date of Easter is defined as the first Sunday after the full moon following the spring equinox (March 21).

Syntax

easter_date(

year);

Parameters Description
year Optional. Defines the year used to calculate the Easter date (between 1970 and 2037). If omitted, the current year in local time is used by default.

Technical Details

Return Value: Returns the Unix timestamp of the Easter date.
PHP Version: 4+
Changelog: In PHP 4.3, theyear parameter became optional.

PHP Calendar Reference Manual PHP Calendar Reference Manual