date.html.svn-base

来自「PHP 知识管理系统(基于树结构的知识管理系统), 英文原版的PHP源码。」· SVN-BASE 代码 · 共 747 行 · 第 1/3 页

SVN-BASE
747
字号
        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
        <td class="sig">
        <a id="Date-Date.getMonthNumber"></a>
            <b>Date.getMonthNumber</b>(&nbsp;<code>String name</code>&nbsp;) : Number            <div class="mdesc">
                        <div class="short">&lt;static&gt; Get the zero-based javascript month number for the given short/full month name.Override this function...</div>
            <div class="long">
                &lt;static&gt; Get the zero-based javascript month number for the given short/full month name.Override this function for international dates.    <div class="mdetail-params">
        <strong>Parameters:</strong>
        <ul><li><code>name</code> : String<div class="sub-desc">The short/full month name.</div></li>        </ul>
        <strong>Returns:</strong>
        <ul>
            <li><code>Number</code><div class="sub-desc">The zero-based javascript month number.</div></li>
        </ul>
    </div>
                </div>
                        </div>
        </td>
        <td class="msource">Date</td>
    </tr>
        <tr class="method-row alt expandable">
        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
        <td class="sig">
        <a id="Date-Date.getShortDayName"></a>
            <b>Date.getShortDayName</b>(&nbsp;<code>Number day</code>&nbsp;) : String            <div class="mdesc">
                        <div class="short">&lt;static&gt; Get the short day name for the given day number.Override this function for international dates.</div>
            <div class="long">
                &lt;static&gt; Get the short day name for the given day number.Override this function for international dates.    <div class="mdetail-params">
        <strong>Parameters:</strong>
        <ul><li><code>day</code> : Number<div class="sub-desc">A zero-based javascript day number.</div></li>        </ul>
        <strong>Returns:</strong>
        <ul>
            <li><code>String</code><div class="sub-desc">The short day name.</div></li>
        </ul>
    </div>
                </div>
                        </div>
        </td>
        <td class="msource">Date</td>
    </tr>
        <tr class="method-row expandable">
        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
        <td class="sig">
        <a id="Date-Date.getShortMonthName"></a>
            <b>Date.getShortMonthName</b>(&nbsp;<code>Number month</code>&nbsp;) : String            <div class="mdesc">
                        <div class="short">&lt;static&gt; Get the short month name for the given month number.Override this function for international dates.</div>
            <div class="long">
                &lt;static&gt; Get the short month name for the given month number.Override this function for international dates.    <div class="mdetail-params">
        <strong>Parameters:</strong>
        <ul><li><code>month</code> : Number<div class="sub-desc">A zero-based javascript month number.</div></li>        </ul>
        <strong>Returns:</strong>
        <ul>
            <li><code>String</code><div class="sub-desc">The short month name.</div></li>
        </ul>
    </div>
                </div>
                        </div>
        </td>
        <td class="msource">Date</td>
    </tr>
        <tr class="method-row alt expandable">
        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
        <td class="sig">
        <a id="Date-Date.parseDate"></a>
            <b>Date.parseDate</b>(&nbsp;<code>String input</code>, <code>String format</code>&nbsp;) : Date            <div class="mdesc">
                        <div class="short">&lt;static&gt; Parses the passed string using the specified format. Note that this function expects dates in normal c...</div>
            <div class="long">
                &lt;static&gt; Parses the passed string using the specified format. Note that this function expects dates in normal calendarformat, meaning that months are 1-based (1 = January) and not zero-based like in JavaScript dates.  Any part ofthe date format that is not specified will default to the current date value for that part.  Time parts can alsobe specified, but default to 0.  Keep in mind that the input date string must precisely match the specified formatstring or the parse operation will fail.Example Usage:<pre><code><i>//dt = Fri May 25 2007 (current date)</i><b>var</b> dt = <b>new</b> Date();<i>//dt = Thu May 25 2006 (today's month/day <b>in</b> 2006)</i>dt = Date.parseDate(<em>"2006"</em>, <em>"Y"</em>);<i>//dt = Sun Jan 15 2006 (all date parts specified)</i>dt = Date.parseDate(<em>"2006-01-15"</em>, <em>"Y-m-d"</em>);<i>//dt = Sun Jan 15 2006 15:20:01 GMT-0600 (CST)</i>dt = Date.parseDate(<em>"2006-01-15 3:20:01 PM"</em>, <em>"Y-m-d h:i:s A"</em> );</code></pre>    <div class="mdetail-params">
        <strong>Parameters:</strong>
        <ul><li><code>input</code> : String<div class="sub-desc">The unparsed date as a string.</div></li><li><code>format</code> : String<div class="sub-desc">The format the date is in.</div></li>        </ul>
        <strong>Returns:</strong>
        <ul>
            <li><code>Date</code><div class="sub-desc">The parsed date.</div></li>
        </ul>
    </div>
                </div>
                        </div>
        </td>
        <td class="msource">Date</td>
    </tr>
        <tr class="method-row expandable">
        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
        <td class="sig">
        <a id="Date-add"></a>
            <b>add</b>(&nbsp;<code>String interval</code>, <code>Number value</code>&nbsp;) : Date            <div class="mdesc">
                        <div class="short">Provides a convenient method of performing basic date arithmetic.  This methoddoes not modify the Date instance bein...</div>
            <div class="long">
                Provides a convenient method of performing basic date arithmetic.  This methoddoes not modify the Date instance being called - it creates and returnsa new Date instance containing the resulting date value.Examples:<pre><code><i>//Basic usage:</i><b>var</b> dt = <b>new</b> Date(<em>'10/29/2006'</em>).add(Date.DAY, 5);document.write(dt); <i>//returns <em>'Fri Oct 06 2006 00:00:00'</em></i><i>//Negative values will subtract correctly:</i><b>var</b> dt2 = <b>new</b> Date(<em>'10/1/2006'</em>).add(Date.DAY, -5);document.write(dt2); <i>//returns <em>'Tue Sep 26 2006 00:00:00'</em></i><i>//You can even chain several calls together <b>in</b> one line!</i><b>var</b> dt3 = <b>new</b> Date(<em>'10/1/2006'</em>).add(Date.DAY, 5).add(Date.HOUR, 8).add(Date.MINUTE, -30);document.write(dt3); //returns <em>'Fri Oct 06 2006 07:30:00'</em></code></pre>    <div class="mdetail-params">
        <strong>Parameters:</strong>
        <ul><li><code>interval</code> : String<div class="sub-desc">A valid date interval enum value.</div></li><li><code>value</code> : Number<div class="sub-desc">The amount to add to the current date.</div></li>        </ul>
        <strong>Returns:</strong>
        <ul>
            <li><code>Date</code><div class="sub-desc">The new Date instance.</div></li>
        </ul>
    </div>
                </div>
                        </div>
        </td>
        <td class="msource">Date</td>
    </tr>
        <tr class="method-row alt expandable">
        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
        <td class="sig">
        <a id="Date-between"></a>
            <b>between</b>(&nbsp;<code>Date start</code>, <code>Date end</code>&nbsp;) : Boolean            <div class="mdesc">
                        <div class="short">Checks if this date falls on or between the given start and end dates.</div>
            <div class="long">
                Checks if this date falls on or between the given start and end dates.    <div class="mdetail-params">
        <strong>Parameters:</strong>
        <ul><li><code>start</code> : Date<div class="sub-desc">Start date</div></li><li><code>end</code> : Date<div class="sub-desc">End date</div></li>        </ul>
        <strong>Returns:</strong>
        <ul>
            <li><code>Boolean</code><div class="sub-desc">true if this date falls on or between the given start and end dates.</div></li>
        </ul>
    </div>
                </div>
                        </div>
        </td>
        <td class="msource">Date</td>
    </tr>
        <tr class="method-row expandable">
        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
        <td class="sig">
        <a id="Date-clearTime"></a>
            <b>clearTime</b>(&nbsp;<code>Boolean clone</code>&nbsp;) : Date            <div class="mdesc">
                        <div class="short">Clears any time information from this date.</div>
            <div class="long">
                Clears any time information from this date.    <div class="mdetail-params">
        <strong>Parameters:</strong>
        <ul><li><code>clone</code> : Boolean<div class="sub-desc">true to create a clone of this date, clear the time and return it (defaults to false).</div></li>        </ul>
        <strong>Returns:</strong>
        <ul>
            <li><code>Date</code><div class="sub-desc">this or the clone.</div></li>
        </ul>
    </div>
                </div>
                        </div>
        </td>
        <td class="msource">Date</td>
    </tr>
        <tr class="method-row alt expandable">
        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
        <td class="sig">
        <a id="Date-clone"></a>
            <b>clone</b>() : Date            <div class="mdesc">
                        <div class="short">Creates and returns a new Date instance with the exact same date value as the called instance.Dates are copied and p...</div>
            <div class="long">
                Creates and returns a new Date instance with the exact same date value as the called instance.Dates are copied and passed by reference, so if a copied date variable is modified later, the originalvariable will also be changed.  When the intention is to create a new variable that will notmodify the original instance, you should create a clone.Example of correctly cloning a date:<pre><code><i>//wrong way:</i><b>var</b> orig = <b>new</b> Date(<em>'10/1/2006'</em>);<b>var</b> copy = orig;copy.setDate(5);document.write(orig);  <i>//returns <em>'Thu Oct 05 2006'</em>!</i><i>//correct way:</i><b>var</b> orig = <b>new</b> Date(<em>'10/1/2006'</em>);<b>var</b> copy = orig.clone();copy.setDate(5);document.write(orig);  //returns <em>'Thu Oct 01 2006'</em></code></pre>    <div class="mdetail-params">
        <strong>Parameters:</strong>
        <ul><li>None.</li>        </ul>
        <strong>Returns:</strong>
        <ul>
            <li><code>Date</code><div class="sub-desc">The new Date instance.</div></li>
        </ul>
    </div>
                </div>
                        </div>
        </td>
        <td class="msource">Date</td>
    </tr>
        <tr class="method-row expandable">
        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
        <td class="sig">
        <a id="Date-format"></a>
            <b>format</b>(&nbsp;<code>String format</code>&nbsp;) : String            <div class="mdesc">
                        <div class="short">Formats a date given the supplied format string.</div>
            <div class="long">
                Formats a date given the supplied format string.    <div class="mdetail-params">
        <strong>Parameters:</strong>
        <ul><li><code>format</code> : String<div class="sub-desc">The format string.</div></li>        </ul>
        <strong>Returns:</strong>
        <ul>
            <li><code>String</code><div class="sub-desc">The formatted date.</div></li>
        </ul>
    </div>
                </div>
                        </div>
        </td>
        <td class="msource">Date</td>
    </tr>
        <tr class="method-row alt expandable">
        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
        <td class="sig">
        <a id="Date-getDayOfYear"></a>
            <b>getDayOfYear</b>() : Number            <div class="mdesc">
                        <div class="short">Get the numeric day number of the year, adjusted for leap year.</div>
            <div class="long">
                Get the numeric day number of the year, adjusted for leap year.    <div class="mdetail-params">
        <strong>Parameters:</strong>
        <ul><li>None.</li>        </ul>
        <strong>Returns:</strong>
        <ul>
            <li><code>Number</code><div class="sub-desc">0 to 364 (365 in leap years).</div></li>
        </ul>
    </div>
                </div>
                        </div>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?