Latest web development tutorials

PHP easter_days () function

PHP Calendar Reference Manual PHP Calendar Reference Manual

Examples

Easter output in different years and the number of days between March 21 of:

<?php
echo "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.";
?>

Running instance »

Definition and Usage

easter_days () returns the year specified number of days between Easter March 21 in.

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_days( year,method);

参数 描述
year 可选。定义用于计算复活节日期的年份,为一个数字。若省略,默认使用当年,本地时间。
method 可选。允许您计算其它历法的复活节日期。例如,如果设置为 CAL_EASTER_ROMAN,则使用 1582 - 1752 年期间的格利高里历法。

technical details

return value: Returns the number of days specified year and Easter between March 21 of.
PHP version: 4+
Update log: In PHP 4.3 in, year parameter is optional, method parameters are new.


PHP Calendar Reference Manual PHP Calendar Reference Manual