Sophie

Sophie

distrib > Mageia > 4 > i586 > by-pkgid > f800694edefe91adea2624f711a41a2d > files > 2675

php-manual-en-5.5.7-1.mga4.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Get number of days after March 21 on which Easter falls for a given year</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.easter-date.html">easter_date</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.frenchtojd.html">FrenchToJD</a></div>
 <div class="up"><a href="ref.calendar.html">Calendar Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.easter-days" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">easter_days</h1>
  <p class="verinfo">(PHP 4, PHP 5)</p><p class="refpurpose"><span class="refname">easter_days</span> &mdash; <span class="dc-title">Get number of days after March 21 on which Easter falls for a given year</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.easter-days-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">int</span> <span class="methodname"><strong>easter_days</strong></span>
    ([ <span class="methodparam"><span class="type">int</span> <code class="parameter">$year</code></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$method</code><span class="initializer"> = CAL_EASTER_DEFAULT</span></span>
  ]] )</div>

  <p class="para rdfs-comment">
   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 class="para">
   This function can be used instead of
    <span class="function"><a href="function.easter-date.html" class="function">easter_date()</a></span> to calculate Easter for years
   which fall outside the range of Unix timestamps (i.e. before 1970
   or after 2037).
  </p>
  <p class="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.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.easter-days-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>

    <dt>

     <span class="term"><em><code class="parameter">year</code></em></span>
     <dd>

      <p class="para">
       The year as a positive number
      </p>
     </dd>

    </dt>
  
    <dt>

     <span class="term"><em><code class="parameter">method</code></em></span>
     <dd>

      <p class="para">
       Allows to calculate easter dates based
       on the Gregorian calendar during the years 1582 - 1752 when set to
       <strong><code>CAL_EASTER_ROMAN</code></strong>. See the <a href="calendar.constants.html" class="link">calendar constants</a> for more valid
       constants.      
       </p>
     </dd>

    </dt>
  
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.easter-days-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   The number of days after March 21st that the Easter Sunday
   is in the given <em><code class="parameter">year</code></em>.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.easter-days-changelog">
  <h3 class="title">Changelog</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>Version</th>
       <th>Description</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>4.3.0</td>
       <td>
        The <em><code class="parameter">year</code></em> parameter is optional and defaults
        to the current year according to the local time if omitted.
       </td>
      </tr>

      <tr>
       <td>4.3.0</td>
       <td>
        The <em><code class="parameter">method</code></em> parameter was introduced.
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.easter-days-examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   <div class="example" id="example-2247">
    <p><strong>Example #1  <span class="function"><strong>easter_days()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">easter_days</span><span style="color: #007700">(</span><span style="color: #0000BB">1999</span><span style="color: #007700">);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;14,&nbsp;i.e.&nbsp;April&nbsp;4<br /></span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">easter_days</span><span style="color: #007700">(</span><span style="color: #0000BB">1492</span><span style="color: #007700">);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;32,&nbsp;i.e.&nbsp;April&nbsp;22<br /></span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">easter_days</span><span style="color: #007700">(</span><span style="color: #0000BB">1913</span><span style="color: #007700">);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;&nbsp;2,&nbsp;i.e.&nbsp;March&nbsp;23<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.easter-days-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"> <span class="function"><a href="function.easter-date.html" class="function" rel="rdfs-seeAlso">easter_date()</a> - Get Unix timestamp for midnight on Easter of a given year</span></li>
   </ul>
  </p>
 </div>

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.easter-date.html">easter_date</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.frenchtojd.html">FrenchToJD</a></div>
 <div class="up"><a href="ref.calendar.html">Calendar Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>