打印 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 中年参数变为可选,并且方法添加了参数 |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!