Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > media > main > by-pkgid > 0afeee9cca140e167a996902b9a677c5 > files > 534

php-manual-en-4.3.0-2mdk.noarch.rpm

<HTML
><HEAD
><TITLE
>easter_days</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="PHP Manual"
HREF="index.html"><LINK
REL="UP"
TITLE="Calendar functions"
HREF="ref.calendar.html"><LINK
REL="PREVIOUS"
TITLE="easter_date"
HREF="function.easter-date.html"><LINK
REL="NEXT"
TITLE="FrenchToJD"
HREF="function.frenchtojd.html"><META
HTTP-EQUIV="Content-type"
CONTENT="text/html; charset=ISO-8859-1"></HEAD
><BODY
CLASS="refentry"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>PHP Manual</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="function.easter-date.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="function.frenchtojd.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="function.easter-days"
></A
>easter_days</H1
><DIV
CLASS="refnamediv"
><A
NAME="AEN10317"
></A
><P
>    (PHP 3&#62;= 3.0.9, PHP 4 )</P
>easter_days&nbsp;--&nbsp;
     Get number of days after March 21 on which Easter falls for a
     given year
    </DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN10320"
></A
><H2
>Description</H2
>int <B
CLASS="methodname"
>easter_days</B
> ( [int year [, int method]])<BR
></BR
><P
>&#13;     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.
    </P
><P
>&#13;     Since <TT
CLASS="literal"
>PHP</TT
> 4.3.0, the <TT
CLASS="parameter"
><I
>year</I
></TT
>
     parameter is optional and defaults to the current year according to the
     localtime if ommited.
    </P
><P
>&#13;     The <TT
CLASS="parameter"
><I
>method</I
></TT
> parameter was also introduced in
     <TT
CLASS="literal"
>PHP</TT
> 4.3.0 and allows to calculate easter dates based
     on the Gregorian calendar during the years 1582 - 1752 when set to
     <TT
CLASS="constant"
><B
>CAL_EASTER_ROMAN</B
></TT
>. See the <A
HREF="ref.calendar.html#calendar.constants"
>calendar constants</A
> for more valid
     constants.
    </P
><P
>&#13;     This function can be used instead of
     <A
HREF="function.easter-date.html"
><B
CLASS="function"
>easter_date()</B
></A
> to calculate Easter for years
     which fall outside the range of UNIX timestamps (i.e. before 1970
     or after 2037).
     <TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
CLASS="EXAMPLE"
><TR
><TD
><DIV
CLASS="example"
><A
NAME="AEN10342"
></A
><P
><B
>Example 1. <B
CLASS="function"
>easter_days()</B
> example</B
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><PRE
CLASS="php"
>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  */</PRE
></TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
>
    </P
><P
>&#13;     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.
    </P
><P
>&#13;     (The code is based on a C program by Simon Kershaw,
     &#60;webmaster@ely.anglican.org&#62;)
    </P
><P
>&#13;     See also <A
HREF="function.easter-date.html"
><B
CLASS="function"
>easter_date()</B
></A
>.
    </P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="function.easter-date.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="function.frenchtojd.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>easter_date</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="ref.calendar.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>FrenchToJD</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>