Sophie

Sophie

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

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

<HTML
><HEAD
><TITLE
>easter_date</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="cal_to_jd"
HREF="function.cal-to-jd.html"><LINK
REL="NEXT"
TITLE="easter_days"
HREF="function.easter-days.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.cal-to-jd.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="function.easter-days.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="function.easter-date"
></A
>easter_date</H1
><DIV
CLASS="refnamediv"
><A
NAME="AEN10291"
></A
><P
>    (PHP 3&#62;= 3.0.9, PHP 4 )</P
>easter_date&nbsp;--&nbsp;
     Get UNIX timestamp for midnight on Easter of a given year
    </DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN10294"
></A
><H2
>Description</H2
>int <B
CLASS="methodname"
>easter_date</B
> ( [int year])<BR
></BR
><P
>&#13;     Returns the UNIX timestamp corresponding to midnight on Easter of
     the given year.
    </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;     <SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>Warning:</I
></SPAN
> This function will generate
     a warning if the year is outside of the range for 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="AEN10308"
></A
><P
><B
>Example 1. <B
CLASS="function"
>easter_date()</B
> example</B
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><PRE
CLASS="php"
>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" */</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 <A
HREF="function.easter-days.html"
><B
CLASS="function"
>easter_days()</B
></A
> for calculating Easter
     before 1970 or after 2037.
    </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.cal-to-jd.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.easter-days.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>cal_to_jd</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"
>easter_days</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>