PHP easter_days()関数
例
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では、yearパラメーターがオプションになり、 methodパラメーターが追加されました。 |
❮PHPカレンダーリファレンス