CVS update: php3/doc/functions

From: Date: Wed, 02 Jun 1999 23:53:16 +0000
Subject: CVS update: php3/doc/functions
Groups: php.dev 
Request: Send a blank email to php-dev+get-6483@lists.php.net to get a copy of this message
Date: Wednesday June 2, 1999 @ 19:53 Author: cmv Update of /repository/php3/doc/functions In directory php:/tmp/cvs-serv6946/doc/functions Modified Files: datetime.sgml Log Message: added easter_date() and easter_days() functions Index: php3/doc/functions/datetime.sgml diff -u php3/doc/functions/datetime.sgml:1.28 php3/doc/functions/datetime.sgml:1.29 --- php3/doc/functions/datetime.sgml:1.28 Wed Jun 2 13:22:30 1999 +++ php3/doc/functions/datetime.sgml Wed Jun 2 19:53:16 1999 @@ -272,6 +272,116 @@ </refsect1> </refentry> + <refentry id="function.easter_date"> + <refnamediv> + <refname>easter_date</refname> + <refpurpose>get UNIX timestamp for midnight on Easter of a given year</refpurpose> + <refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcdef>int <function>easter_date</function></funcdef> + <paramdef>int <parameter>year</parameter></paramdef> + </funcsynopsis> + <para> + Returns the UNIX timestamp corresponding to midnight on + Easter of the given year. If no year is specified, the + current year is assumed. + </para> + <para> + <emphasis>Warning:</emphasis> This function will generate + a warning if the year is outside of the range for UNIX + timestamps (i.e. before 1970 or after 2037). + <example> + <title><function>easter_date</function> example</title> + <programlisting> +echo date( "M-d-Y", easter_date(1999) ); /* "Apr-04-1999" */ +echo date( "M-d-Y", easter_date(2000) ); /* "Apr-23-2000" */ +echo date( "M-d-Y", easter_date(2001) ); /* "Apr-15-2001" */ +</programlisting> + </example> + </para> + <para> + 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. + </para> + <para> + (The code is based on a C program by Simon Kershaw, + &lt;webmaster@ely.anglican.org&gt;) + </para> + <para> + See <function>easter_days</function> for calculating Easter + before 1970 or after 2037. + </para> + </refsect1> + </refentry> + + <refentry id="function.easter_days"> + <refnamediv> + <refname>easter_days</refname> + <refpurpose>get number of days after March 21 on which Easter falls for a given year</refpurpose> + <refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcdef>int <function>easter_days</function></funcdef> + <paramdef>int <parameter>year</parameter></paramdef> + </funcsynopsis> + <para> + Returns the number of days after March 21 on which Easter falls + for a given year. If no year is specified, the current year is assumed. + </para> + <para> + This function can be used instead of <function>easter_date</function> + to calculate Easter for years which fall outside the range of UNIX + timestamps (i.e. before 1970 or after 2037). + <example> + <title><function>easter_date</function> example</title> + <programlisting> +echo easter_days(1999); /* 14, i.e. April 4 */ +echo easter_days(1492); /* 32, i.e. April 22 */ +echo easter_days(1913); /* 2, i.e. March 23 */ +</programlisting> + </example> + </para> + <para> + 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. + </para> + <para> + (The code is based on a C program by Simon Kershaw, + &lt;webmaster@ely.anglican.org&gt;) + </para> + <para> + See also <function>easter_date</function>. + </para> + </refsect1> + </refentry> + <refentry id="function.mktime"> <refnamediv>

« previous php.dev (#6483) next »