Hướng dẫn dùng easter time trong PHP
(PHP 4, PHP 5, PHP 7, PHP 8) easter_date — Get Unix timestamp for midnight on Easter of a given year easter_date(?int Warning
This function will generate a warning if the year is outside of the range for Unix timestamps (i.e. typically before 1970 or after 2037 on 32bit systems). The date of Easter Day was defined by the Council of Nicaea in AD325 as the Sunday after the first full moon which falls on or after the Spring Equinox. The Equinox is assumed to always fall on 21st March, so the calculation reduces to determining the date of the full moon and the date of the following Sunday. The algorithm used here
was introduced around the year 532 by Dionysius Exiguus. Under the Julian Calendar (for years before 1753) a simple 19-year cycle is used to track the phases of the Moon. Under the Gregorian Calendar (for years after 1753 - devised by Clavius and Lilius, and introduced by Pope Gregory XIII in October 1582, and into Britain and its then colonies in September 1752) two correction factors are added to make the cycle more accurate. The year as a number between
1970 an 2037. If omitted or Allows Easter dates to be calculated based on the Julian calendar when set to The easter date as a unix timestamp. Example #1 easter_date() example Note: easter_date() relies on your system's C library time functions, rather than using PHP's internal date and time functions. As a consequence, easter_date() uses the As a workaround, you can use the easter_days() with DateTime and DateInterval to calculate the start of Easter in your PHP time zone as follows:
$base->add(new DateInterval("P{$days}D")); The above example will output: Easter in 2012 is on April 8 Easter in 2013 is on March 31 Easter in 2014 is on April 20 Easter in 2015 is on April 5 See Also
maxie ¶ 14 years ago
$de;
Alexander Bliznyuk ¶ 5 years ago
py dot lebecq at gmail dot com ¶ 12 years ago
mktime(0, 0, 0, $easterMonth, $easterDay + 2, $easterYear), Guillaume Dufrene ¶ 9 years ago
phpuser ¶ 17 years ago
$E; adwil at live dot com ¶ 8 years ago
|