目录

PHP easter_days() 函数

❮ PHP 日历参考

示例

打印 3 月 21 日之后不同年份的复活节天数:

<?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.";
?>
运行示例 »

定义和用法

easter_days() 函数返回给定年份中复活节日在 3 月 21 日之后的天数。

提示:复活节的日期定义为春分(3月21日)或之后的第一个满月之后的星期日。


语法

easter_days( year,method);

参数值

Parameter Description
year Optional. Specifies a year as a number. Default is the current year, local time
method Optional. Allows you to calculate easter dates based on other calendars. E.g. it uses the Gregorian calendar during the years 1582 - 1752 when set to CAL_EASTER_ROMAN


技术细节

返回值: 返回给定年份中复活节日在 3 月 21 日之后的天数
PHP 版本: 4+
变更日志: 在 PHP 4.3 中参数变为可选,并且方法添加了参数

❮ PHP 日历参考