uTools-Manuals/docs/php/easter_date.html
2019-04-28 19:00:34 +08:00

126 lines
5.5 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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>得到指定年份的复活节午夜时的Unix时间戳。</title>
</head>
<body class="docs"><div id="layout">
<div id="layout-content"><div id="function.easter-date" class="refentry">
<div class="refnamediv">
<h1 class="refname">easter_date</h1>
<p class="verinfo">(PHP 4, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">easter_date</span> &mdash; <span class="dc-title">得到指定年份的复活节午夜时的Unix时间戳。</span></p>
</div>
<div class="refsect1 description" id="refsect1-function.easter-date-description">
<h3 class="title">说明</h3>
<div class="methodsynopsis dc-description">
<span class="methodname"><strong>easter_date</strong></span>
([ <span class="methodparam"><span class="type">int</span> <code class="parameter">$year</code></span>
] ) : <span class="type">int</span></div>
<p class="para rdfs-comment">
返回指定年份的复活节午夜时的Unix时间戳。
</p>
<div class="warning"><strong class="warning">Warning</strong>
<p class="para">
如果给定的年份超出Unix时间戳的范围比如1970年以前或2037年以后该函数将返回一个警告。
</p>
</div>
<p class="para">
复活节的日期是由尼西亚议会在AD325年确定的为每年春分月圆后的第一个星期日。春分一般是在3月21日这就简化为只要计算满月的日期和紧挨的星期日的日期。这里所用的算法是在532年由Dionysius Exiguus所介绍的参考了Julian历法和Gregorian历法这两个历法来提高精确度。在1753年以前用Julian历法计算该历法是一个以19年为周期来确定月亮的相位的历法。在1753年以后用Gregorian历法计算该历法由Clavius和Lilius发明由Pope Gregory 8世在1582年推广
</p>
</div>
<div class="refsect1 parameters" id="refsect1-function.easter-date-parameters">
<h3 class="title">参数</h3>
<p class="para">
<dl>
<dt>
<code class="parameter">year</code></dt>
<dd>
<p class="para">
1970年至2037年之间的数字形式的年份。
</p>
</dd>
</dl>
</p>
</div>
<div class="refsect1 returnvalues" id="refsect1-function.easter-date-returnvalues">
<h3 class="title">返回值</h3>
<p class="para">
复活节日期的Unix时间戳。
</p>
</div>
<div class="refsect1 changelog" id="refsect1-function.easter-date-changelog">
<h3 class="title">更新日志</h3>
<p class="para">
<table class="doctable informaltable">
<thead>
<tr>
<th>版本</th>
<th>说明</th>
</tr>
</thead>
<tbody class="tbody">
<tr>
<td>Since 4.3.0</td>
<td>
<code class="parameter">year</code>参数可选,缺省的默认值是当年。
</td>
</tr>
</tbody>
</table>
</p>
</div>
<div class="refsect1 examples" id="refsect1-function.easter-date-examples">
<h3 class="title">范例</h3>
<p class="para">
<div class="example" id="example-2645">
<p><strong>Example #1 <span class="function"><strong>easter_date()</strong></span> example</strong></p>
<div class="example-contents">
<div class="phpcode"><pre><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">date</span><span style="color: #007700">(</span><span style="color: #DD0000">"M-d-Y"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">easter_date</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;Apr-04-1999<br /></span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">date</span><span style="color: #007700">(</span><span style="color: #DD0000">"M-d-Y"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">easter_date</span><span style="color: #007700">(</span><span style="color: #0000BB">2000</span><span style="color: #007700">));&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;Apr-23-2000<br /></span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">date</span><span style="color: #007700">(</span><span style="color: #DD0000">"M-d-Y"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">easter_date</span><span style="color: #007700">(</span><span style="color: #0000BB">2001</span><span style="color: #007700">));&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;Apr-15-2001<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</pre></div>
</div>
</div>
</p>
</div>
<div class="refsect1 seealso" id="refsect1-function.easter-date-seealso">
<h3 class="title">参见</h3>
<p class="para">
<ul class="simplelist">
<li class="member">
<span class="function"><a href="easter_days.html" class="function" rel="rdfs-seeAlso">easter_days()</a> - 得到指定年份的3月21日到复活节之间的天数</span> for calculating Easter
before 1970 or after 2037
</li>
</ul>
</p>
</div>
</div></div></div></body></html>