Latest web development tutorials

PHP easter_date () function

PHP Calendar Reference Manual PHP Calendar Reference Manual

Examples

Output in different years of the date of Easter:

<?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));
?>

Running instance »

Definition and Usage

easter_date () function returns the specified year Easter midnight Unix timestamp.

Tip: The date of Easter is defined at the spring equinox (March 21) after the full moon every year on the first Sunday.

grammar

easter_date( year);

参数 描述
year 可选。定义用于计算复活节日期的年份(1970 至 2037 之间)。若省略,默认使用当年,本地时间。

technical details

return value: Returns the Unix timestamp of the date of Easter.
PHP version: 4+
Update log: In PHP 4.3 in, year parameter is optional.


PHP Calendar Reference Manual PHP Calendar Reference Manual