この例は、2004 年の復活祭の日付を計算するものです。
require_once "Date/Holidays.php"; $germany = &Date_Holidays::factory('Germany', 2004, 'en_EN'); if (Date_Holidays::isError($germany)) { die('ファクトリでドライバオブジェクトを作成できませんでした'); } $easter = &$germany->getHoliday('easter', 'de_DE'); if (!Date_Holidays::isError($easter)) { print_r($easter->toArray()); } |
これは、次のような配列を返します。
Array ( [internalName] => easter [title] => Easter Sunday [date] => date Object ( [year] => 2004 [month] => 04 [day] => 11 [hour] => 0 [minute] => 0 [second] => 0 [tz] => date_timezone Object ( [id] => UTC [longname] => Coordinated Universal Time [shortname] => UTC [hasdst] => [dstlongname] => Coordinated Universal Time [dstshortname] => UTC [offset] => 0 [default] => ) ) ) |