Output the number of days between Easter and March 21 for different years:
<?phpecho "Easter Day is ". easter_days() . " days after March 21 this year.<br />";echo "Easter Day was ". easter_days(1990) . " days after March 21 in 1990.<br />"; >";echo "Easter Day was ". easter_days(1342) . " days after March 21 in 1342.<br />";echo "Easter Day will be ". easter_days(2050) . " days after March 21 in 2050.";?>easter_days() returns the number of days between Easter and March 21 for 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_days( year,method);
parameter | describe |
---|---|
year | Optional. Defines the year used to calculate the date of Easter, as a number. If omitted, the current year and local time are used by default. |
method | Optional. Allows you to calculate Easter dates for other calendars. For example, if set to CAL_EASTER_ROMAN, the Gregorian calendar for the period 1582 - 1752 is used. |
Return value: | Returns the number of days between Easter and March 21 in the specified year. |
---|---|
PHP version: | 4+ |
Update log: | In PHP 4.3, the year parameter is optional and the method parameter is new. |