diff options
author | t7yang <t7yang@gmail.com> | 2022-01-10 08:38:07 +0800 |
---|---|---|
committer | Irvin <irvinfly@gmail.com> | 2022-02-16 02:35:54 +0800 |
commit | c40612041809fe289aba58aefa170bbe784aba1f (patch) | |
tree | 8ca89b071d04afcf7abd6d9a04d0765a041d9c8a /files/zh-cn/web/javascript/reference/global_objects/date | |
parent | 12a899ab8540bc84f56a0dc6491be80a48499d49 (diff) | |
download | translated-content-c40612041809fe289aba58aefa170bbe784aba1f.tar.gz translated-content-c40612041809fe289aba58aefa170bbe784aba1f.tar.bz2 translated-content-c40612041809fe289aba58aefa170bbe784aba1f.zip |
remove name attribute for zh-CN
Diffstat (limited to 'files/zh-cn/web/javascript/reference/global_objects/date')
41 files changed, 252 insertions, 252 deletions
diff --git a/files/zh-cn/web/javascript/reference/global_objects/date/getdate/index.html b/files/zh-cn/web/javascript/reference/global_objects/date/getdate/index.html index 57f12998f6..7e7e429c3d 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/date/getdate/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/date/getdate/index.html @@ -11,21 +11,21 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getDate -<h2 id="Syntax" name="Syntax">语法</h2> +<h2 id="Syntax">语法</h2> <pre class="syntaxbox language-html">dateObj.getDate()</pre> -<h2 id="Parameters" name="Parameters">参数</h2> +<h2 id="Parameters">参数</h2> <p>无</p> -<h2 id="Description" name="Description">描述</h2> +<h2 id="Description">描述</h2> <p><code>getDate() </code>返回一个1 到 31的整数值。</p> -<h2 id="Examples" name="Examples">例子</h2> +<h2 id="Examples">例子</h2> -<h3 id="Example:_Using_getDate" name="Example:_Using_getDate">例子: 使用getDate()<code>方法</code></h3> +<h3 id="Example:_Using_getDate">例子: 使用getDate()<code>方法</code></h3> <p>下面第二条语句将值25赋给 day 变量,该值基于日期对象 <code>Xmax95</code>的值。</p> @@ -67,7 +67,7 @@ alert(day); // 25</pre> <p>{{Compat("javascript.builtins.Date.getDate")}}</p> -<h2 id="See_Also" name="See_Also">相关链接</h2> +<h2 id="See_Also">相关链接</h2> <ul> <li>{{jsxref("Date.prototype.getUTCDate()")}}</li> diff --git a/files/zh-cn/web/javascript/reference/global_objects/date/getday/index.html b/files/zh-cn/web/javascript/reference/global_objects/date/getday/index.html index 584180a8fb..d9c68dacb4 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/date/getday/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/date/getday/index.html @@ -11,18 +11,18 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getDay -<h2 id="Syntax" name="Syntax">语法</h2> +<h2 id="Syntax">语法</h2> <pre class="syntaxbox language-html"><em>dateObj</em>.getDay() </pre> -<h3 id="Description" name="Description">返回值</h3> +<h3 id="Description">返回值</h3> <p>根据本地时间,返回一个0到6之间的整数值,代表星期几: 0 代表星期日, 1 代表星期一,2 代表星期二, 依次类推。</p> -<h2 id="Examples" name="Examples">例子</h2> +<h2 id="Examples">例子</h2> -<h3 id="Example_Using_getDay" name="Example:_Using_getDay">使用<code>getDay()</code></h3> +<h3 id="Example_Using_getDay">使用<code>getDay()</code></h3> <p>下面第二条语句,基于{{jsxref("Date")}}对象 <code>Xmas95</code> 的值,把 1 赋值给 <code>weekday</code>。也就是说1995年12月25日是星期一。</p> @@ -77,7 +77,7 @@ console.log(new Intl.DateTimeFormat('de-DE', options).format(Xmas95)); <p>{{Compat("javascript.builtins.Date.getDay")}}</p> -<h2 id="See_Also" name="See_Also">相关链接</h2> +<h2 id="See_Also">相关链接</h2> <ul> <li>{{jsxref("Date.prototype.getUTCDate()")}}</li> diff --git a/files/zh-cn/web/javascript/reference/global_objects/date/getfullyear/index.html b/files/zh-cn/web/javascript/reference/global_objects/date/getfullyear/index.html index c29a10aa45..2791749e86 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/date/getfullyear/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/date/getfullyear/index.html @@ -19,12 +19,12 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getFullYear -<h2 id="Syntax" name="Syntax">语法</h2> +<h2 id="Syntax">语法</h2> <pre class="brush: html">dateObj.getFullYear() </pre> -<h3 id="Description" name="Description">返回值</h3> +<h3 id="Description">返回值</h3> <p>根据当地时间,返回一个对应于给定日期的年份数字。</p> @@ -32,9 +32,9 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getFullYear <p><code>getFullYear()</code>返回的值是绝对数。 对于1000到9999之间的日期,<code>getFullYear()</code>返回一个四位数字,如1995。使用此函数确保在2000年后兼容。</p> -<h2 id="Examples" name="Examples">例子</h2> +<h2 id="Examples">例子</h2> -<h3 id="Example:_Using_getFullYear" name="Example:_Using_getFullYear">使用<code>getFullYear()</code></h3> +<h3 id="Example:_Using_getFullYear">使用<code>getFullYear()</code></h3> <p>下面的例子将当前年份的四位数值分配给变量<code>year</code>。</p> @@ -78,7 +78,7 @@ var year = today.getFullYear(); <p>{{Compat("javascript.builtins.Date.getFullYear")}}</p> -<h2 id="See_Also" name="See_Also">相关链接</h2> +<h2 id="See_Also">相关链接</h2> <ul> <li>{{jsxref("Date.prototype.getUTCFullYear()")}}</li> diff --git a/files/zh-cn/web/javascript/reference/global_objects/date/gethours/index.html b/files/zh-cn/web/javascript/reference/global_objects/date/gethours/index.html index 62d35dd713..2046e96d75 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/date/gethours/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/date/gethours/index.html @@ -15,17 +15,17 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getHours <pre class="syntaxbox language-html"><var>dateObj</var>.getHours()</pre> -<h3 id="Parameters" name="Parameters">参数</h3> +<h3 id="Parameters">参数</h3> <p>无</p> -<h3 id="Description" name="Description">返回值</h3> +<h3 id="Description">返回值</h3> <p><code>getHours</code>返回一个0 到 23之间的整数值。</p> -<h2 id="Examples" name="Examples">例子</h2> +<h2 id="Examples">例子</h2> -<h3 id="Example:_Using_getHours" name="Example:_Using_getHours">例子:使用<code>getHours</code>方法</h3> +<h3 id="Example:_Using_getHours">例子:使用<code>getHours</code>方法</h3> <p>下面第二条语句,基于日期对象 <code>Xmas95 </code>的值,把 23 赋值给了变量 <code>hours。</code></p> @@ -65,7 +65,7 @@ alert(hours); // 23</pre> <p>{{Compat("javascript.builtins.Date.getHours")}}</p> -<h2 id="See_Also" name="See_Also">相关链接</h2> +<h2 id="See_Also">相关链接</h2> <ul> <li>{{jsxref("Date.prototype.getUTCHours()")}}</li> diff --git a/files/zh-cn/web/javascript/reference/global_objects/date/getmilliseconds/index.html b/files/zh-cn/web/javascript/reference/global_objects/date/getmilliseconds/index.html index 2cbc0b9d30..231cf2d7f9 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/date/getmilliseconds/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/date/getmilliseconds/index.html @@ -11,21 +11,21 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getMilliseconds -<h2 id="Syntax" name="Syntax">语法</h2> +<h2 id="Syntax">语法</h2> <pre class="syntaxbox language-html"><var>dateObj</var>.getMilliseconds()</pre> -<h3 id="Parameters" name="Parameters">参数</h3> +<h3 id="Parameters">参数</h3> <p>无</p> -<h3 id="Description" name="Description">描述</h3> +<h3 id="Description">描述</h3> <p><code>getMilliseconds() </code>方法返回一个0 到 999的整数。</p> -<h2 id="Examples" name="Examples">例子</h2> +<h2 id="Examples">例子</h2> -<h3 id="Example:_Using_getMilliseconds" name="Example:_Using_getMilliseconds">例子:使用<code>getMilliseconds</code>方法</h3> +<h3 id="Example:_Using_getMilliseconds">例子:使用<code>getMilliseconds</code>方法</h3> <p>下例中,将当前时间的毫秒数赋值给变量 <code>ms</code>。</p> @@ -64,7 +64,7 @@ ms = Today.getMilliseconds();</pre> <p>{{Compat("javascript.builtins.Date.getMilliseconds")}}</p> -<h2 id="See_Also" name="See_Also">相关链接</h2> +<h2 id="See_Also">相关链接</h2> <ul> <li>{{jsxref("Date.prototype.getUTCMilliseconds()")}}</li> diff --git a/files/zh-cn/web/javascript/reference/global_objects/date/getminutes/index.html b/files/zh-cn/web/javascript/reference/global_objects/date/getminutes/index.html index a27f4c265d..bd99ad3db0 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/date/getminutes/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/date/getminutes/index.html @@ -9,21 +9,21 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getMinutes <div>{{EmbedInteractiveExample("pages/js/date-getminutes.html")}}</div> -<h2 id="Syntax" name="Syntax">语法</h2> +<h2 id="Syntax">语法</h2> <pre class="syntaxbox language-html">dateObj.getMinutes()</pre> -<h3 id="Parameters" name="Parameters">参数</h3> +<h3 id="Parameters">参数</h3> <p>无</p> -<h3 id="Description" name="Description">描述</h3> +<h3 id="Description">描述</h3> <p><code>getMinutes </code>返回一个0 到 59的整数值。</p> -<h2 id="Examples" name="Examples">例子</h2> +<h2 id="Examples">例子</h2> -<h3 id="Example:_Using_getMinutes" name="Example:_Using_getMinutes">例子:使用<code>getMinutes方法</code></h3> +<h3 id="Example:_Using_getMinutes">例子:使用<code>getMinutes方法</code></h3> <p>下例中,第二行语句运行过后,变量 <code>minutes </code>的值为15,也就是说 <code>Xmas95 </code>这个日期对象的值为某时15分某秒。</p> @@ -63,7 +63,7 @@ var minutes = Xmas95.getMinutes();</pre> <p>{{Compat("javascript.builtins.Date.getMinutes")}}</p> -<h2 id="See_Also" name="See_Also">相关链接</h2> +<h2 id="See_Also">相关链接</h2> <ul> <li>{{jsxref("Date.prototype.getUTCMinutes()")}}</li> diff --git a/files/zh-cn/web/javascript/reference/global_objects/date/getmonth/index.html b/files/zh-cn/web/javascript/reference/global_objects/date/getmonth/index.html index 63a953f263..ce008a4ba0 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/date/getmonth/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/date/getmonth/index.html @@ -18,21 +18,21 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getMonth -<h2 id="Syntax" name="Syntax">语法</h2> +<h2 id="Syntax">语法</h2> <pre class="syntaxbox language-html">dateObj.getMonth()</pre> -<h3 id="Parameters" name="Parameters">参数</h3> +<h3 id="Parameters">参数</h3> <p>无</p> -<h3 id="Description" name="Description">返回值</h3> +<h3 id="Description">返回值</h3> <p><code>getMonth</code>返回一个0 到 11的整数值: 0 代表一月份,1 代表二月份, 2 代表三月份,依次类推。</p> -<h2 id="Examples" name="Examples">例子</h2> +<h2 id="Examples">例子</h2> -<h3 id="Example:_Using_getMonth" name="Example:_Using_getMonth">使用 <code>getMonth()</code></h3> +<h3 id="Example:_Using_getMonth">使用 <code>getMonth()</code></h3> <p>下面第二条语句,基于 {{jsxref("Date")}} 对象 Xmas95 的值,把11赋值给变量 <code>month。</code></p> @@ -79,7 +79,7 @@ console.log(month); // 11</pre> <p>{{Compat("javascript.builtins.Date.getMonth")}}</p> </div> -<h2 id="See_Also" name="See_Also">相关链接</h2> +<h2 id="See_Also">相关链接</h2> <ul> <li>{{jsxref("Date.prototype.getUTCMonth()")}}</li> diff --git a/files/zh-cn/web/javascript/reference/global_objects/date/getseconds/index.html b/files/zh-cn/web/javascript/reference/global_objects/date/getseconds/index.html index 1cb80b2ea8..4543e5c2b2 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/date/getseconds/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/date/getseconds/index.html @@ -11,21 +11,21 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getSeconds -<h2 id="Syntax" name="Syntax">语法</h2> +<h2 id="Syntax">语法</h2> <pre class="syntaxbox language-html">dateObj.getSeconds()</pre> -<h3 id="Parameters" name="Parameters">参数</h3> +<h3 id="Parameters">参数</h3> <p>无</p> -<h3 id="Description" name="Description">描述</h3> +<h3 id="Description">描述</h3> <p>该方法返回一个 0 到 59 的整数值。</p> -<h2 id="Examples" name="Examples">例子</h2> +<h2 id="Examples">例子</h2> -<h3 id="Example:_Using_getSeconds" name="Example:_Using_getSeconds">例子: 使用<code>getSeconds方法</code></h3> +<h3 id="Example:_Using_getSeconds">例子: 使用<code>getSeconds方法</code></h3> <p>下面第二条语句,基于日期对象 <code>Xmas95</code> 的值,把 30 赋值给变量 <code>secs</code>。</p> @@ -67,7 +67,7 @@ var secs = Xmas95.getSeconds();</pre> <p>{{Compat("javascript.builtins.Date.getSeconds")}}</p> -<h2 id="See_Also" name="See_Also">相关链接</h2> +<h2 id="See_Also">相关链接</h2> <ul> <li>{{jsxref("Date.prototype.getUTCSeconds()")}}</li> diff --git a/files/zh-cn/web/javascript/reference/global_objects/date/gettime/index.html b/files/zh-cn/web/javascript/reference/global_objects/date/gettime/index.html index 8e8bb5bd41..d42eb7731c 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/date/gettime/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/date/gettime/index.html @@ -18,19 +18,19 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getTime -<h2 id="Syntax" name="Syntax">语法</h2> +<h2 id="Syntax">语法</h2> <pre class="syntaxbox"><code>dateObj.getTime() </code></pre> -<h3 id="Parameters" name="Parameters">参数</h3> +<h3 id="Parameters">参数</h3> <p>无。</p> -<h3 id="Description" name="Description">返回值</h3> +<h3 id="Description">返回值</h3> <p><code>getTime</code> 方法的返回值一个数值,表示从1970年1月1日0时0分0秒(UTC,即协调世界时)距离该日期对象所代表时间的毫秒数。</p> -<h2 id="Examples" name="Examples">例子</h2> +<h2 id="Examples">例子</h2> <h3 id="使用_getTime()_复制日期对象">使用 getTime() 复制日期对象</h3> @@ -86,7 +86,7 @@ console.log("Operation took " + (end.getTime() - start.getTime()) + " msec");</p <p>{{Compat("javascript.builtins.Date.getTime")}}</p> -<h2 id="See_Also" name="See_Also">相关链接</h2> +<h2 id="See_Also">相关链接</h2> <ul> <li>{{jsxref("Date.prototype.setTime()")}}</li> diff --git a/files/zh-cn/web/javascript/reference/global_objects/date/gettimezoneoffset/index.html b/files/zh-cn/web/javascript/reference/global_objects/date/gettimezoneoffset/index.html index 90b7d1a962..7f2d81f94e 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/date/gettimezoneoffset/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/date/gettimezoneoffset/index.html @@ -11,21 +11,21 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getTimezoneOffset -<h2 id="Syntax" name="Syntax">语法</h2> +<h2 id="Syntax">语法</h2> <pre class="syntaxbox language-html">dateObj.getTimezoneOffset()</pre> -<h3 id="Parameters" name="Parameters">参数</h3> +<h3 id="Parameters">参数</h3> <p>无</p> -<h3 id="Description" name="Description">返回值</h3> +<h3 id="Description">返回值</h3> <p>时区偏差(time-zone offset)表示协调世界时(UTC)与本地时区之间的差值,单位为分钟。需要注意的是如果本地时区后于协调世界时,则该差值为正值,如果先于协调世界时则为负值。例如你所在时区为 UTC+10(澳大利亚东部标准时间),将会返回 -600。对于同一个时区,夏令时(Daylight Saving Time)将会改变这个值。</p> -<h2 id="Examples" name="Examples">例子</h2> +<h2 id="Examples">例子</h2> -<h3 id="Example_Using_getTimezoneOffset" name="Example:_Using_getTimezoneOffset">例子: 使用<code>getTimezoneOffset方法</code></h3> +<h3 id="Example_Using_getTimezoneOffset">例子: 使用<code>getTimezoneOffset方法</code></h3> <pre class="brush:js">var x = new Date(); var currentTimeZoneOffsetInHours = x.getTimezoneOffset() / 60; diff --git a/files/zh-cn/web/javascript/reference/global_objects/date/getutcdate/index.html b/files/zh-cn/web/javascript/reference/global_objects/date/getutcdate/index.html index e5c6c73ef9..5f91b84e1a 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/date/getutcdate/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/date/getutcdate/index.html @@ -9,21 +9,21 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getUTCDate <div>{{EmbedInteractiveExample("pages/js/date-getutcdate.html")}}</div> -<h2 id="Syntax" name="Syntax">语法</h2> +<h2 id="Syntax">语法</h2> <pre class="syntaxbox"><code><var>dateObj</var>.getUTCDate()</code></pre> -<h3 id="Parameters" name="Parameters">参数</h3> +<h3 id="Parameters">参数</h3> <p>无</p> -<h3 id="Returns" name="Returns">返回值</h3> +<h3 id="Returns">返回值</h3> <p><code>getUTCDate()</code> 返回一个 1 到 31 的整数值</p> -<h2 id="Examples" name="Examples">例子</h2> +<h2 id="Examples">例子</h2> -<h3 id="Example:_Using_getUTCDate" name="Example:_Using_getUTCDate">例子: 使用 <code>getUTCDate()</code> 方法</h3> +<h3 id="Example:_Using_getUTCDate">例子: 使用 <code>getUTCDate()</code> 方法</h3> <p>下面的例子是把当前日期的天数部分赋值给变量 <code>day</code>.</p> @@ -64,7 +64,7 @@ var day = today.getUTCDate(); <p>{{Compat("javascript.builtins.Date.getUTCDate")}}</p> </div> -<h2 id="See_also" name="See_also">相关链接</h2> +<h2 id="See_also">相关链接</h2> <ul> <li>{{jsxref("Date.prototype.getDate()")}}</li> diff --git a/files/zh-cn/web/javascript/reference/global_objects/date/getutcday/index.html b/files/zh-cn/web/javascript/reference/global_objects/date/getutcday/index.html index 97052ed86a..cdc417c67e 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/date/getutcday/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/date/getutcday/index.html @@ -11,21 +11,21 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getUTCDay -<h2 id="Syntax" name="Syntax">语法</h2> +<h2 id="Syntax">语法</h2> <pre class="syntaxbox"><code><var>dateObj</var>.getUTCDay()</code></pre> -<h3 id="Parameters" name="Parameters">参数</h3> +<h3 id="Parameters">参数</h3> <p>无。</p> -<h3 id="Returns" name="Returns">返回值</h3> +<h3 id="Returns">返回值</h3> <p><code>getUTCDay()</code> 方法返回一个对应一星期中第几天的整数:0 代表星期天,1 代表星期一,2 代表星期二,依次类推。</p> -<h2 id="Examples" name="Examples">例子</h2> +<h2 id="Examples">例子</h2> -<h3 id="Example:_Using_getUTCDay" name="Example:_Using_getUTCDay">例子: 使用 <code>getUTCDay()</code> 方法</h3> +<h3 id="Example:_Using_getUTCDay">例子: 使用 <code>getUTCDay()</code> 方法</h3> <p>下面的例子是把当前日期的星期部分赋值给变量 <code>weekday</code>。</p> @@ -66,7 +66,7 @@ var weekday = today.getUTCDay(); <p>{{Compat("javascript.builtins.Date.getUTCDay")}}</p> </div> -<h2 id="See_also" name="See_also">相关链接</h2> +<h2 id="See_also">相关链接</h2> <ul> <li>{{jsxref("Date.prototype.getUTCDate()")}}</li> diff --git a/files/zh-cn/web/javascript/reference/global_objects/date/getutcfullyear/index.html b/files/zh-cn/web/javascript/reference/global_objects/date/getutcfullyear/index.html index fcddc106e9..da28d32ca2 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/date/getutcfullyear/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/date/getutcfullyear/index.html @@ -11,21 +11,21 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getUTCFullYear -<h2 id="Syntax" name="Syntax">语法</h2> +<h2 id="Syntax">语法</h2> <pre class="syntaxbox"><code><var>dateObj</var>.getUTCFullYear()</code></pre> -<h3 id="Parameters" name="Parameters">参数</h3> +<h3 id="Parameters">参数</h3> <p>无。</p> -<h3 id="Returns" name="Returns">返回值</h3> +<h3 id="Returns">返回值</h3> <p><code>getUTCFullYear()</code> 返回一个绝对数值,符合 Year-2000 标准,例如 1995。</p> -<h2 id="Examples" name="Examples">例子</h2> +<h2 id="Examples">例子</h2> -<h3 id="Example:_Using_getUTCFullYear" name="Example:_Using_getUTCFullYear">例子: 使用 <code>getUTCFullYear()</code> 方法</h3> +<h3 id="Example:_Using_getUTCFullYear">例子: 使用 <code>getUTCFullYear()</code> 方法</h3> <p>下面的例子是把当前年份的四位数值复制给变量 <code>year</code>。</p> @@ -66,7 +66,7 @@ var year = today.getUTCFullYear(); <p>{{Compat("javascript.builtins.Date.getUTCFullYear")}}</p> </div> -<h2 id="See_also" name="See_also">相关链接</h2> +<h2 id="See_also">相关链接</h2> <ul> <li>{{jsxref("Date.prototype.getFullYear()")}}</li> diff --git a/files/zh-cn/web/javascript/reference/global_objects/date/getutchours/index.html b/files/zh-cn/web/javascript/reference/global_objects/date/getutchours/index.html index 1ba8124b2e..15b62e78cf 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/date/getutchours/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/date/getutchours/index.html @@ -11,21 +11,21 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getUTCHours -<h2 id="Syntax" name="Syntax">语法</h2> +<h2 id="Syntax">语法</h2> <pre class="syntaxbox"><code><var>dateObj</var>.getUTCHours()</code></pre> -<h3 id="Parameters" name="Parameters">参数</h3> +<h3 id="Parameters">参数</h3> <p>无。</p> -<h3 id="Returns" name="Returns">返回值</h3> +<h3 id="Returns">返回值</h3> <p><code>getUTCHours()</code> 返回一个 0 到 23 的整数。</p> -<h2 id="Examples" name="Examples">例子</h2> +<h2 id="Examples">例子</h2> -<h3 id="Example:_Using_getUTCHours" name="Example:_Using_getUTCHours">例子: 使用 <code>getUTCHours()</code> 方法</h3> +<h3 id="Example:_Using_getUTCHours">例子: 使用 <code>getUTCHours()</code> 方法</h3> <p>下例将当前时间的小时部分赋值给变量 <code>hours</code>。</p> @@ -66,7 +66,7 @@ var hours = today.getUTCHours(); <p>{{Compat("javascript.builtins.Date.getUTCHours")}}</p> </div> -<h2 id="See_also" name="See_also">相关链接</h2> +<h2 id="See_also">相关链接</h2> <ul> <li>{{jsxref("Date.prototype.getHours()")}}</li> diff --git a/files/zh-cn/web/javascript/reference/global_objects/date/getutcmilliseconds/index.html b/files/zh-cn/web/javascript/reference/global_objects/date/getutcmilliseconds/index.html index 11b4f14b24..a3d2f98568 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/date/getutcmilliseconds/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/date/getutcmilliseconds/index.html @@ -9,21 +9,21 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getUTCMilliseconds <div>{{EmbedInteractiveExample("pages/js/date-getutcmilliseconds.html")}}</div> -<h2 id="Syntax" name="Syntax">语法</h2> +<h2 id="Syntax">语法</h2> <pre class="syntaxbox"><code><var>dateObj</var>.getUTCMilliseconds()</code></pre> -<h3 id="Parameters" name="Parameters">参数</h3> +<h3 id="Parameters">参数</h3> <p>无。</p> -<h3 id="Returns" name="Returns">返回值</h3> +<h3 id="Returns">返回值</h3> <p><code>getUTCMilliseconds()</code> 返回一个 0 到 999 的整数。</p> -<h2 id="Examples" name="Examples">例子</h2> +<h2 id="Examples">例子</h2> -<h3 id="Example:_Using_getUTCMilliseconds" name="Example:_Using_getUTCMilliseconds">例子: 使用 <code>getUTCMilliseconds()</code> 方法</h3> +<h3 id="Example:_Using_getUTCMilliseconds">例子: 使用 <code>getUTCMilliseconds()</code> 方法</h3> <p>下例将当前时间的毫秒部分赋值给变量 <code>milliseconds</code>。</p> @@ -64,7 +64,7 @@ var milliseconds = today.getUTCMilliseconds(); <p>{{Compat("javascript.builtins.Date.getUTCMilliseconds")}}</p> </div> -<h2 id="See_also" name="See_also">相关链接</h2> +<h2 id="See_also">相关链接</h2> <ul> <li>{{jsxref("Date.prototype.getMilliseconds()")}}</li> diff --git a/files/zh-cn/web/javascript/reference/global_objects/date/getutcminutes/index.html b/files/zh-cn/web/javascript/reference/global_objects/date/getutcminutes/index.html index b1b7f85581..ea4408c4d3 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/date/getutcminutes/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/date/getutcminutes/index.html @@ -9,21 +9,21 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getUTCMinutes <div>{{EmbedInteractiveExample("pages/js/date-getutcminutes.html")}}</div> -<h2 id="Syntax" name="Syntax">语法</h2> +<h2 id="Syntax">语法</h2> <pre class="syntaxbox"><code><var>dateObj</var>.getUTCMinutes()</code></pre> -<h3 id="Parameters" name="Parameters">参数</h3> +<h3 id="Parameters">参数</h3> <p>无。</p> -<h3 id="Returns" name="Returns">返回值</h3> +<h3 id="Returns">返回值</h3> <p><code>getUTCMinutes()</code> 返回一个 0 到 59 的整数。</p> -<h2 id="Examples" name="Examples">例子</h2> +<h2 id="Examples">例子</h2> -<h3 id="Example:_Using_getUTCMinutes" name="Example:_Using_getUTCMinutes">例子: 使用 <code>getUTCMinutes()</code> 方法</h3> +<h3 id="Example:_Using_getUTCMinutes">例子: 使用 <code>getUTCMinutes()</code> 方法</h3> <p>下例将当前时间的分钟部分赋值给变量 <code>minutes</code>。</p> @@ -64,7 +64,7 @@ var minutes = today.getUTCMinutes(); <p>{{Compat("javascript.builtins.Date.getUTCMinutes")}}</p> </div> -<h2 id="See_also" name="See_also">相关链接</h2> +<h2 id="See_also">相关链接</h2> <ul> <li>{{jsxref("Date.prototype.getMinutes()")}}</li> diff --git a/files/zh-cn/web/javascript/reference/global_objects/date/getutcmonth/index.html b/files/zh-cn/web/javascript/reference/global_objects/date/getutcmonth/index.html index 7b7147560d..6b2d4cd909 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/date/getutcmonth/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/date/getutcmonth/index.html @@ -11,21 +11,21 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getUTCMonth -<h2 id="Syntax" name="Syntax">语法</h2> +<h2 id="Syntax">语法</h2> <pre class="syntaxbox"><code><var>dateObj</var>.getUTCMonth()</code></pre> -<h3 id="Parameters" name="Parameters">参数</h3> +<h3 id="Parameters">参数</h3> <p>无。</p> -<h3 id="Returns" name="Returns">返回值</h3> +<h3 id="Returns">返回值</h3> <p><code>getUTCMonth()</code> 返回一个 0 到 11 的整数,分别对应以下月份:0 代表一月,1 代表二月,2 代表三月,依次类推。</p> -<h2 id="Examples" name="Examples">例子</h2> +<h2 id="Examples">例子</h2> -<h3 id="Example:_Using_getUTCMonth" name="Example:_Using_getUTCMonth">例子: 使用 <code>getUTCMonth()</code> 方法</h3> +<h3 id="Example:_Using_getUTCMonth">例子: 使用 <code>getUTCMonth()</code> 方法</h3> <p>下例将当前时间的月份赋值给变量 <code>month</code>。</p> @@ -66,7 +66,7 @@ var month = today.getUTCMonth(); <p>{{Compat("javascript.builtins.Date.getUTCMonth")}}</p> </div> -<h2 id="See_also" name="See_also">相关链接</h2> +<h2 id="See_also">相关链接</h2> <ul> <li>{{jsxref("Date.prototype.getMonth()")}}</li> diff --git a/files/zh-cn/web/javascript/reference/global_objects/date/getutcseconds/index.html b/files/zh-cn/web/javascript/reference/global_objects/date/getutcseconds/index.html index 194de38a29..ef54de9e9c 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/date/getutcseconds/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/date/getutcseconds/index.html @@ -9,21 +9,21 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getUTCSeconds <div>{{EmbedInteractiveExample("pages/js/date-getutcseconds.html")}}</div> -<h2 id="Syntax" name="Syntax">语法</h2> +<h2 id="Syntax">语法</h2> <pre class="syntaxbox"><code><var>dateObj</var>.getUTCSeconds()</code></pre> -<h3 id="Parameters" name="Parameters">参数</h3> +<h3 id="Parameters">参数</h3> <p>无。</p> -<h3 id="Returns" name="Returns">返回值</h3> +<h3 id="Returns">返回值</h3> <p><code>getUTCSeconds()</code> 返回一个 0 到 59 的整数。</p> -<h2 id="Examples" name="Examples">例子</h2> +<h2 id="Examples">例子</h2> -<h3 id="Example:_Using_getUTCSeconds" name="Example:_Using_getUTCSeconds">例子: 使用 <code>getUTCSeconds()</code> 方法</h3> +<h3 id="Example:_Using_getUTCSeconds">例子: 使用 <code>getUTCSeconds()</code> 方法</h3> <p>下例将当前时间的秒数部分赋值给变量 <code>seconds</code>。</p> @@ -64,7 +64,7 @@ var seconds = today.getUTCSeconds(); <p>{{Compat("javascript.builtins.Date.getUTCSeconds")}}</p> </div> -<h2 id="See_also" name="See_also">相关链接</h2> +<h2 id="See_also">相关链接</h2> <ul> <li>{{jsxref("Date.prototype.getSeconds()")}}</li> diff --git a/files/zh-cn/web/javascript/reference/global_objects/date/getyear/index.html b/files/zh-cn/web/javascript/reference/global_objects/date/getyear/index.html index 1067341a6f..a35e5e4ac6 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/date/getyear/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/date/getyear/index.html @@ -7,15 +7,15 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getYear <p>getYear() 方法返回指定的本地日期的年份。因为 <code>getYear</code> 不返回千禧年[full years] ("year 2000 problem"),所以这个方法不再被使用,现在替换为 {{jsxref("Date.getFullYear", "getFullYear")}} .</p> -<h2 id="Syntax" name="Syntax">Syntax</h2> +<h2 id="Syntax">Syntax</h2> <pre class="syntaxbox"><code>dateObj.getYear() </code></pre> -<h3 id="Parameters" name="Parameters">Parameters</h3> +<h3 id="Parameters">Parameters</h3> <p>None.</p> -<h3 id="Description" name="Description">Returns</h3> +<h3 id="Description">Returns</h3> <p>The <code>getYear</code> method returns the year minus 1900; thus:</p> @@ -27,9 +27,9 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getYear <p>To take into account years before and after 2000, you should use {{jsxref("Date.getFullYear", "getFullYear()")}} instead of <code>getYear</code> so that the year is specified in full.</p> -<h2 id="Backward_Compatibility" name="Backward_Compatibility">Backward Compatibility</h2> +<h2 id="Backward_Compatibility">Backward Compatibility</h2> -<h3 id="JavaScript_1.2_and_earlier" name="JavaScript_1.2_and_earlier">Behaviour in JavaScript 1.2 and earlier</h3> +<h3 id="JavaScript_1.2_and_earlier">Behaviour in JavaScript 1.2 and earlier</h3> <p>The <code>getYear</code> method returns either a 2-digit or 4-digit year:</p> @@ -38,9 +38,9 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getYear <li>For years less than 1900 or greater than 1999, the value returned by <code>getYear</code> is the four-digit year. For example, if the year is 1856, the value returned is 1856. If the year is 2026, the value returned is 2026.</li> </ul> -<h2 id="Examples" name="Examples">Examples</h2> +<h2 id="Examples">Examples</h2> -<h3 id="Example:_Years_between_1900_and_1999" name="Example:_Years_between_1900_and_1999">Example: Years between 1900 and 1999</h3> +<h3 id="Example:_Years_between_1900_and_1999">Example: Years between 1900 and 1999</h3> <p>The second statement assigns the value 95 to the variable <code>year</code>.</p> @@ -48,7 +48,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getYear var year = Xmas.getYear(); // returns 95 </pre> -<h3 id="Example:_Years_above_1999" name="Example:_Years_above_1999">Example: Years above 1999</h3> +<h3 id="Example:_Years_above_1999">Example: Years above 1999</h3> <p>The second statement assigns the value 100 to the variable <code>year</code>.</p> @@ -56,7 +56,7 @@ var year = Xmas.getYear(); // returns 95 var year = Xmas.getYear(); // returns 100 </pre> -<h3 id="Example:_Years_below_1900" name="Example:_Years_below_1900">Example: Years below 1900</h3> +<h3 id="Example:_Years_below_1900">Example: Years below 1900</h3> <p>The second statement assigns the value -100 to the variable <code>year</code>.</p> @@ -64,7 +64,7 @@ var year = Xmas.getYear(); // returns 100 var year = Xmas.getYear(); // returns -100 </pre> -<h3 id="Example:_Setting_and_getting_a_year_between_1900_and_1999" name="Example:_Setting_and_getting_a_year_between_1900_and_1999">Example: Setting and getting a year between 1900 and 1999</h3> +<h3 id="Example:_Setting_and_getting_a_year_between_1900_and_1999">Example: Setting and getting a year between 1900 and 1999</h3> <p>The second statement assigns the value 95 to the variable <code>year</code>, representing the year 1995.</p> @@ -103,7 +103,7 @@ var year = Xmas.getYear(); // returns 95 <p>{{Compat("javascript.builtins.Date.getYear")}}</p> -<h2 id="See_Also" name="See_Also">See also</h2> +<h2 id="See_Also">See also</h2> <ul> <li>{{jsxref("Date.prototype.getFullYear()")}}</li> diff --git a/files/zh-cn/web/javascript/reference/global_objects/date/parse/index.html b/files/zh-cn/web/javascript/reference/global_objects/date/parse/index.html index 5b0a6cf01d..eef2f86594 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/date/parse/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/date/parse/index.html @@ -18,7 +18,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/parse -<h2 id="Syntax" name="Syntax">语法</h2> +<h2 id="Syntax">语法</h2> <p>显式调用:</p> @@ -29,7 +29,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/parse <pre class="syntaxbox"><code>new Date(<var>dateString</var>).getTime()</code> </pre> -<h3 id="Parameters" name="Parameters">参数</h3> +<h3 id="Parameters">参数</h3> <dl> <dt><code>dateString</code></dt> @@ -42,7 +42,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/parse <dd>一个表示从1970-1-1 00:00:00 UTC到给定日期字符串所表示时间的毫秒数的数值。如果参数不能解析为一个有效的日期,则返回{{jsxref("NaN")}}。</dd> </dl> -<h2 id="Description" name="Description">描述</h2> +<h2 id="Description">描述</h2> <p><code>parse</code> 方法接受一个日期字符串(例如 "<code>Dec 25, 1995</code>"),并返回从1970-1-1 00:00:00 UTC到该日期字符串所表示日期的毫秒数。该方法在基于字符串值设置日期值时很有用,例如结合使用{{jsxref("Global_Objects/Date/setTime", "setTime()")}} 方法和 {{jsxref("Global_Objects/Date", "Date()")}} 构造函数。</p> @@ -60,7 +60,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/parse <p>由于 <code>parse()</code> 是 {{jsxref("Date")}} 的一个静态方法 , 所以应该使用 <code>Date.parse()</code> 来调用,而不是作为 {{jsxref("Date")}} 的实例方法。</p> -<h3 id="Differences in assumed time-zone" name="Differences in assumed time-zone">默认时区的区别</h3> +<h3 id="Differences in assumed time-zone">默认时区的区别</h3> <p>当输入为 "<code>March 7, 2014</code>" 时, <code>parse()</code> 将默认使用本地时区。但如果使用 ISO 格式如 <code>"2014-03-07"</code> ,则会被默认为 UTC (ES5 和 ECMAScript 2015) 时区。 因此除非系统本地时区为 UTC,由这些字符串解析出的 {{jsxref("Date")}} 对象可能会因为 ECMAScript 版本不同而代表不同的时间。这意味着两个看起来等效的字符串可能因为它们的格式不同而被转换成不同的值。</p> @@ -91,9 +91,9 @@ new Date('2014-25-23').toISOString(); Date.parse('foo-bar 2014'); // 返回: NaN</pre> -<h2 id="Examples" name="Examples">例子</h2> +<h2 id="Examples">例子</h2> -<h3 id="Example:_Using_parse" name="Example:_Using_parse">例子:使用 <code>Date.parse()</code></h3> +<h3 id="Example:_Using_parse">例子:使用 <code>Date.parse()</code></h3> <p>如果 <code>IPOdate</code> 是一个已经存在的 {{jsxref("Date")}} 对象,则可以把其设置为本地时间 1995年8月9日。如下:</p> @@ -169,11 +169,11 @@ Date.parse('foo-bar 2014'); <p>{{Compat("javascript.builtins.Date.parse")}}</p> -<h2 id="See_also" name="See_also">兼容性提示</h2> +<h2 id="See_also">兼容性提示</h2> <p>Firefox 49 {{geckoRelease(49)}} 修改了解析2位数年份的方式,从和 Internet Explorer 一致改为和 Google Chrome 浏览器一致。现在,2位数的年份小于等于 <code>50</code> 的将会被解析为21世纪的年份。比如, <code>04/16/17</code> ,在之前会被解析为 1917年4月16日,现在将被解析为 2017年4月16日。为了避免任何可能的同步问题或者有歧义的年份,推荐使用 ISO 8601 格式如 "2017-04-16" ({{bug(1265136)}})。</p> -<h2 id="See_also" name="See_also">相关链接</h2> +<h2 id="See_also">相关链接</h2> <ul> <li>{{jsxref("Date.UTC()")}}</li> diff --git a/files/zh-cn/web/javascript/reference/global_objects/date/setdate/index.html b/files/zh-cn/web/javascript/reference/global_objects/date/setdate/index.html index c2a3e5a5c5..9cbddc4177 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/date/setdate/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/date/setdate/index.html @@ -11,18 +11,18 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/setDate -<h2 id="Syntax" name="Syntax">语法</h2> +<h2 id="Syntax">语法</h2> <pre class="syntaxbox"><code><var>dateObj</var>.setDate(<em>dayValue</em>)</code></pre> -<h3 id="Parameters" name="Parameters">参数</h3> +<h3 id="Parameters">参数</h3> <dl> <dt><code>dayValue</code></dt> <dd>一个整数,表示该月的第几天。</dd> </dl> -<h2 id="Description" name="Description">描述</h2> +<h2 id="Description">描述</h2> <p>如果 <code>dayValue</code> 超出了月份的合理范围,<code>setDate</code> 将会相应地更新 <code>Date</code> 对象。</p> @@ -30,9 +30,9 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/setDate <p>如果dayValue被设置为负数,日期会设置为上个月最后一天往前数这个负数绝对值天数后的日期。-1会设置为上月最后一天的前一天(译者注:例如当前为4月,如果setDate(-2),则为3月29日)</p> -<h2 id="Examples" name="Examples">例子</h2> +<h2 id="Examples">例子</h2> -<h3 id="Example_Using_setDate" name="Example:_Using_setDate">例子:使用<code>setDate</code>方法</h3> +<h3 id="Example_Using_setDate">例子:使用<code>setDate</code>方法</h3> <pre class="brush:js">var theBigDay = new Date(1962, 6, 7); // 1962-07-07 theBigDay.setDate(24); // 1962-07-24 @@ -69,7 +69,7 @@ theBigDay.setDate(32); // 1962-08-01</pre> <p>{{Compat("javascript.builtins.Date.setDate")}}</p> -<h2 id="See_Also" name="See_Also">相关链接</h2> +<h2 id="See_Also">相关链接</h2> <ul> <li>{{jsxref("Date.prototype.getDate()")}}</li> diff --git a/files/zh-cn/web/javascript/reference/global_objects/date/setfullyear/index.html b/files/zh-cn/web/javascript/reference/global_objects/date/setfullyear/index.html index e5693e9e07..5c85e43084 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/date/setfullyear/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/date/setfullyear/index.html @@ -11,11 +11,11 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/setFullYear -<h2 id="Syntax" name="Syntax">语法</h2> +<h2 id="Syntax">语法</h2> <pre class="syntaxbox language-html">dateObj.setFullYear(yearValue[, monthValue[, dayValue]])</pre> -<h3 id="Parameters" name="Parameters">参数</h3> +<h3 id="Parameters">参数</h3> <dl> <dt><code>yearValue</code></dt> @@ -26,15 +26,15 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/setFullYear <dd>一个1到31之间的整数值,表示月份中的第几天。如果你指定了 <code>dayValue</code> 参数,就必须同时指定 <code>monthValue</code>。</dd> </dl> -<h2 id="Description" name="Description">描述</h2> +<h2 id="Description">描述</h2> <p>如果没有指定 <code>monthValue</code> 和<code>dayValue</code> 参数,将会使用 <code>getMonth</code> 和<code>getDate</code> 方法的返回值。</p> <p>如果有一个参数超出了合理的范围,<code>setFullYear</code> 方法会更新其他参数值,日期对象的日期值也会被相应更新。 例如,为 <code>monthValue </code>指定 15, 则年份会加1,月份值会为3。</p> -<h2 id="Examples" name="Examples">例子</h2> +<h2 id="Examples">例子</h2> -<h3 id="Example:_Using_setFullYear" name="Example:_Using_setFullYear">例子:使用<code>setFullYear</code>方法</h3> +<h3 id="Example:_Using_setFullYear">例子:使用<code>setFullYear</code>方法</h3> <pre class="brush:js language-js">var theBigDay = new Date(); theBigDay.setFullYear(1997);</pre> @@ -70,7 +70,7 @@ theBigDay.setFullYear(1997);</pre> <p>{{Compat("javascript.builtins.Date.setFullYear")}}</p> -<h2 id="See_Also" name="See_Also">相关链接</h2> +<h2 id="See_Also">相关链接</h2> <ul> <li>{{jsxref("Date.prototype.getUTCFullYear()")}}</li> diff --git a/files/zh-cn/web/javascript/reference/global_objects/date/sethours/index.html b/files/zh-cn/web/javascript/reference/global_objects/date/sethours/index.html index 43786dadd9..a5708b4fd6 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/date/sethours/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/date/sethours/index.html @@ -11,16 +11,16 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/setHours -<h2 id="Syntax" name="Syntax">语法</h2> +<h2 id="Syntax">语法</h2> <pre class="syntaxbox">dateObj.setHours(<em>hoursValue</em>[, <em>minutesValue</em>[, <em>secondsValue</em>[, <em>msValue</em>]]]) </pre> -<h3 id="Versions_prior_to_JavaScript_1.3" name="Versions_prior_to_JavaScript_1.3">JavaScript 1.3版本之前</h3> +<h3 id="Versions_prior_to_JavaScript_1.3">JavaScript 1.3版本之前</h3> <pre class="syntaxbox"><code>dateObj.setHours(<em>hoursValue</em>) </code></pre> -<h3 id="Parameters" name="Parameters">参数</h3> +<h3 id="Parameters">参数</h3> <dl> <dt><code>hoursValue</code></dt> @@ -33,15 +33,15 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/setHours <dd>一个 0 到 999 的数字,表示微秒数,如果指定了 <code>msValue</code> 参数,则必须同时指定 <code>minutesValue</code> 和 <code>secondsValue</code> 参数。</dd> </dl> -<h2 id="Description" name="Description">描述</h2> +<h2 id="Description">描述</h2> <p>如果不指定 <code>minutesValue</code>,<code>secondsValue</code> 和 <code>msValue</code> 参数,则会使用{{jsxref("Date.getMinutes", "getMinutes()")}},{{jsxref("Date.getSeconds", "getSeconds()")}} 和{{jsxref("Date.getMilliseconds", "getMilliseconds()")}} 方法的返回值。</p> <p>如果有一个参数超出了合理范围,<code>setHours</code> 会相应地更新日期对象中的日期信息。例如,如果为 <code>secondsValue</code> 指定了 100,则分钟会加 1,然后秒数使用 40。</p> -<h2 id="Examples" name="Examples">例子</h2> +<h2 id="Examples">例子</h2> -<h3 id="Example:_Using_setHours" name="Example:_Using_setHours">例子:使用<code>setHours方法</code></h3> +<h3 id="Example:_Using_setHours">例子:使用<code>setHours方法</code></h3> <pre class="brush:js">var theBigDay = new Date(); theBigDay.setHours(7); @@ -78,7 +78,7 @@ theBigDay.setHours(7); <p>{{Compat("javascript.builtins.Date.setHours")}}</p> -<h2 id="See_Also" name="See_Also">相关链接</h2> +<h2 id="See_Also">相关链接</h2> <ul> <li>{{jsxref("Date.prototype.getHours()")}}</li> diff --git a/files/zh-cn/web/javascript/reference/global_objects/date/setmilliseconds/index.html b/files/zh-cn/web/javascript/reference/global_objects/date/setmilliseconds/index.html index f747c2696c..97a00241c7 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/date/setmilliseconds/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/date/setmilliseconds/index.html @@ -11,24 +11,24 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/setMilliseconds -<h2 id="Syntax" name="Syntax">语法</h2> +<h2 id="Syntax">语法</h2> <pre class="syntaxbox"><var>dateObj</var>.setMilliseconds(<em>millisecondsValue</em>)</pre> -<h3 id="Parameters" name="Parameters">参数</h3> +<h3 id="Parameters">参数</h3> <dl> <dt><code>millisecondsValue</code></dt> <dd>一个 0 到 999 的数字,表示豪秒数。</dd> </dl> -<h2 id="Description" name="Description">描述</h2> +<h2 id="Description">描述</h2> <p>如果指定的数字超出了合理范围,则日期对象的时间信息会被相应地更新。例如,如果指定了 1005,则秒数加 1,豪秒数为 5。</p> -<h2 id="Examples" name="Examples">例子</h2> +<h2 id="Examples">例子</h2> -<h3 id="Example:_Using_setMilliseconds" name="Example:_Using_setMilliseconds">例子:使用<code>setMilliseconds</code></h3> +<h3 id="Example:_Using_setMilliseconds">例子:使用<code>setMilliseconds</code></h3> <pre class="brush:js">var theBigDay = new Date(); theBigDay.setMilliseconds(100); @@ -65,7 +65,7 @@ theBigDay.setMilliseconds(100); <p>{{Compat("javascript.builtins.Date.setMilliseconds")}}</p> -<h2 id="See_Also" name="See_Also">相关链接</h2> +<h2 id="See_Also">相关链接</h2> <ul> <li>{{jsxref("Date.prototype.getMilliseconds()")}}</li> diff --git a/files/zh-cn/web/javascript/reference/global_objects/date/setminutes/index.html b/files/zh-cn/web/javascript/reference/global_objects/date/setminutes/index.html index fbc30b83fc..cb791e5a9c 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/date/setminutes/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/date/setminutes/index.html @@ -11,15 +11,15 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/setMinutes -<h2 id="Syntax" name="Syntax">语法</h2> +<h2 id="Syntax">语法</h2> <pre class="syntaxbox"><var>dateObj</var>.setMinutes(<em>minutesValue</em>[, <em>secondsValue</em>[, <em>msValue</em>]])</pre> -<h3 id="Versions_prior_to_JavaScript_1.3" name="Versions_prior_to_JavaScript_1.3"> JavaScript 1.3之前版本</h3> +<h3 id="Versions_prior_to_JavaScript_1.3"> JavaScript 1.3之前版本</h3> <pre class="syntaxbox"><var>dateObj</var>.setMinutes(<em>minutesValue</em>)</pre> -<h3 id="Parameters" name="Parameters">参数</h3> +<h3 id="Parameters">参数</h3> <dl> <dt><code>minutesValue</code></dt> @@ -36,15 +36,15 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/setMinutes <dd>一个 0 到 999 的数字,表示微秒数,如果指定了 <code>msValue</code> 参数,则必须同时指定 <code>minutesValue</code> 和<code>secondsValue</code> 参数。</dd> </dl> -<h2 id="Description" name="Description">描述</h2> +<h2 id="Description">描述</h2> <p>如果没有指定 <code>secondsValue</code> 和 <code>msValue</code> 参数,就会使用 {{jsxref("Date.getSeconds", "getSeconds()")}} 和 {{jsxref("Date.getMilliseconds", "getmilliseconds()")}} 方法的返回值。</p> <p>如果有一个指定的参数超出了合理范围,<code>setMinutes</code> 会相应地更新日期对象中的时间信息。例如,为 <code>secondsValue</code> 指定 100,分钟数将会加 1,而秒数会为 40。</p> -<h2 id="Examples" name="Examples">例子</h2> +<h2 id="Examples">例子</h2> -<h3 id="Example:_Using_setMinutes" name="Example:_Using_setMinutes">例子:使用<code>setMinutes方法</code></h3> +<h3 id="Example:_Using_setMinutes">例子:使用<code>setMinutes方法</code></h3> <pre class="brush: js">var theBigDay = new Date(); theBigDay.setMinutes(45); @@ -81,7 +81,7 @@ theBigDay.setMinutes(45); <p>{{Compat("javascript.builtins.Date.setMinutes")}}</p> -<h2 id="See_Also" name="See_Also">相关链接</h2> +<h2 id="See_Also">相关链接</h2> <ul> <li>{{jsxref("Date.prototype.getMinutes()")}}</li> diff --git a/files/zh-cn/web/javascript/reference/global_objects/date/setmonth/index.html b/files/zh-cn/web/javascript/reference/global_objects/date/setmonth/index.html index fecc2f00a1..e7df1fc3d7 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/date/setmonth/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/date/setmonth/index.html @@ -9,15 +9,15 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/setMonth <div>{{EmbedInteractiveExample("pages/js/date-setmonth.html")}}</div> -<h2 id="Syntax" name="Syntax">语法</h2> +<h2 id="Syntax">语法</h2> <pre class="syntaxbox"><var>dateObj</var>.setMonth(<em>monthValue</em>[, <em>dayValue</em>])</pre> -<h3 id="Versions_prior_to_JavaScript_1.3" name="Versions_prior_to_JavaScript_1.3">JavaScript 1.3版本之前</h3> +<h3 id="Versions_prior_to_JavaScript_1.3">JavaScript 1.3版本之前</h3> <pre class="syntaxbox"><var>dateObj</var>.setMonth(<em>monthValue</em>)</pre> -<h3 id="Parameter" name="Parameter">参数</h3> +<h3 id="Parameter">参数</h3> <dl> <dt><code>monthValue</code></dt> @@ -31,15 +31,15 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/setMonth <dd>基于 1 January 1970 00:00:00 UTC 开始计算的毫秒数</dd> </dl> -<h2 id="Description" name="Description">描述</h2> +<h2 id="Description">描述</h2> <p>如果不指定 <code>dayValue</code> 参数,就会使用 {{jsxref("Date.getDate", "getDate")}} 方法的返回值。</p> <p>如果有一个指定的参数超出了合理范围,<code>setMonth</code> 会相应地更新日期对象中的日期信息。例如,为 <code>monthValue</code> 指定 15,则年份会加 1,月份将会使用 3。</p> -<h2 id="Examples" name="Examples">例子</h2> +<h2 id="Examples">例子</h2> -<h3 id="Example_Using_setMonth" name="Example:_Using_setMonth">例子:使用<code>setMonth方法</code></h3> +<h3 id="Example_Using_setMonth">例子:使用<code>setMonth方法</code></h3> <pre class="brush: js">var theBigDay = new Date(); theBigDay.setMonth(6); @@ -76,7 +76,7 @@ theBigDay.setMonth(6); <p>{{Compat("javascript.builtins.Date.setMonth")}}</p> -<h2 id="See_Also" name="See_Also">相关链接</h2> +<h2 id="See_Also">相关链接</h2> <ul> <li>{{jsxref("Date.prototype.getMonth()")}}</li> diff --git a/files/zh-cn/web/javascript/reference/global_objects/date/setseconds/index.html b/files/zh-cn/web/javascript/reference/global_objects/date/setseconds/index.html index b22a9cfbf0..b61a894262 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/date/setseconds/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/date/setseconds/index.html @@ -11,7 +11,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/setSeconds -<h2 id="Syntax" name="Syntax">语法</h2> +<h2 id="Syntax">语法</h2> <pre class="syntaxbox"><var>dateObj</var>.setSeconds(<em>secondsValue</em>[, <em>msValue</em>])</pre> @@ -19,7 +19,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/setSeconds <pre class="syntaxbox"><var>dateObj</var>.setSeconds(<em>secondsValue</em>)</pre> -<h3 id="Parameters" name="Parameters">参数</h3> +<h3 id="Parameters">参数</h3> <dl> <dt><code>secondsValue</code></dt> @@ -28,15 +28,15 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/setSeconds <dd>一个 0 到 999 的数字,表示微秒数。</dd> </dl> -<h2 id="Description" name="Description">描述</h2> +<h2 id="Description">描述</h2> <p>如果没有指定 <code>msValue</code> 参数,就会使用 {{jsxref("Date.getMilliseconds", "getMilliseconds()")}} 方法的返回值。</p> <p>如果一个参数超出了合理范围, <code>setSeconds</code> 方法会相应地更新日期对象的时间信息。例如,为 <code>secondsValue</code> 指定 100,则日期对象的分钟数会相应地加 1,秒数将会使用 40。</p> -<h2 id="Examples" name="Examples">例子</h2> +<h2 id="Examples">例子</h2> -<h3 id="Example:_Using_setSeconds" name="Example:_Using_setSeconds">例子:使用<code>setSeconds方法</code></h3> +<h3 id="Example:_Using_setSeconds">例子:使用<code>setSeconds方法</code></h3> <pre class="brush:js">var theBigDay = new Date(); theBigDay.setSeconds(30) @@ -73,7 +73,7 @@ theBigDay.setSeconds(30) <p>{{Compat("javascript.builtins.Date.setSeconds")}}</p> -<h2 id="See_Also" name="See_Also">相关链接</h2> +<h2 id="See_Also">相关链接</h2> <ul> <li>{{jsxref("Date.prototype.getSeconds()")}}</li> diff --git a/files/zh-cn/web/javascript/reference/global_objects/date/settime/index.html b/files/zh-cn/web/javascript/reference/global_objects/date/settime/index.html index d82c54d75d..ef3ce60645 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/date/settime/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/date/settime/index.html @@ -11,28 +11,28 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/setTime -<h2 id="Syntax" name="Syntax">语法</h2> +<h2 id="Syntax">语法</h2> <pre class="syntaxbox"><var>dateObj</var>.setTime(<em>timeValue</em>)</pre> -<h3 id="Parameters" name="Parameters">参数</h3> +<h3 id="Parameters">参数</h3> <dl> <dt><code>timeValue</code></dt> <dd>一个整数,表示从1970-1-1 00:00:00 UTC开始计时的毫秒数。</dd> <dt> - <h3 id="Parameters" name="Parameters">返回值</h3> + <h3 id="Parameters">返回值</h3> </dt> <dd>UTC 1970年1月1日00:00:00与更新日期之间的毫秒数(实际上是自变量的值)。</dd> </dl> -<h2 id="Description" name="Description">描述</h2> +<h2 id="Description">描述</h2> <p>使用 <code>setTime</code> 方法用来把一个日期时间赋值给另一个 <code>Date </code>对象。</p> -<h2 id="Examples" name="Examples">例子</h2> +<h2 id="Examples">例子</h2> -<h3 id="Example_Using_setTime" name="Example:_Using_setTime">例子:使用<code>setTime</code></h3> +<h3 id="Example_Using_setTime">例子:使用<code>setTime</code></h3> <pre>theBigDay = new Date("July 1, 1999"); sameAsBigDay = new Date(); @@ -70,7 +70,7 @@ sameAsBigDay.setTime(theBigDay.getTime()); <p>{{Compat("javascript.builtins.Date.setTime")}}</p> -<h2 id="See_Also" name="See_Also">相关链接</h2> +<h2 id="See_Also">相关链接</h2> <ul> <li>{{jsxref("Date.prototype.getTime()")}}</li> diff --git a/files/zh-cn/web/javascript/reference/global_objects/date/setutcdate/index.html b/files/zh-cn/web/javascript/reference/global_objects/date/setutcdate/index.html index d0f72b4a68..128188f71f 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/date/setutcdate/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/date/setutcdate/index.html @@ -11,24 +11,24 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/setUTCDate -<h2 id="Syntax" name="Syntax">语法</h2> +<h2 id="Syntax">语法</h2> <pre class="syntaxbox"><code><var>dateObj</var>.setUTCDate(<var>dayValue</var>)</code></pre> -<h3 id="Parameters" name="Parameters">参数</h3> +<h3 id="Parameters">参数</h3> <dl> <dt><code>dayValue</code></dt> <dd>一个1-31的整形数字,用来指定日期。</dd> </dl> -<h2 id="Description" name="Description">描述</h2> +<h2 id="Description">描述</h2> <p>如果你指定的参数超出了范围,setUTCDate()会尝试更新对应的{{jsxref("Global_Objects/Date", "Date")}} 中的日期信息。例如,如果你使用了40来作为参数,但是{{jsxref("Global_Objects/Date", "Date")}} 中存储的月份为6月,那么日期将被改写为10且月份被增到7月。</p> -<h2 id="Examples" name="Examples">示例</h2> +<h2 id="Examples">示例</h2> -<h3 id="Example:_Using_setUTCDate" name="Example:_Using_setUTCDate">使用Using <code>setUTCDate()</code></h3> +<h3 id="Example:_Using_setUTCDate">使用Using <code>setUTCDate()</code></h3> <pre class="brush: js">var theBigDay = new Date(); theBigDay.setUTCDate(20); @@ -67,7 +67,7 @@ theBigDay.setUTCDate(20); <p>{{Compat("javascript.builtins.Date.setUTCDate")}}</p> </div> -<h2 id="See_also" name="See_also">相关内容</h2> +<h2 id="See_also">相关内容</h2> <ul> <li>{{jsxref("Date.prototype.getUTCDate()")}}</li> diff --git a/files/zh-cn/web/javascript/reference/global_objects/date/todatestring/index.html b/files/zh-cn/web/javascript/reference/global_objects/date/todatestring/index.html index 6162c68977..e82f87f07c 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/date/todatestring/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/date/todatestring/index.html @@ -11,19 +11,19 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/toDateString -<h2 id="Syntax" name="Syntax">语法</h2> +<h2 id="Syntax">语法</h2> <pre class="syntaxbox"><code><var>dateObj</var>.toDateString()</code></pre> -<h2 id="Description" name="Description">描述</h2> +<h2 id="Description">描述</h2> <p>{{jsxref("Global_Objects/Date", "Date")}} 对象实例引用一个具体的时间点。调用 {{jsxref("Date.toString", "toString")}} 方法会以美式英语和人类易读的形式返回日期对象的格式化字符串。在 <a href="/en-US/docs/SpiderMonkey" title="SpiderMonkey">SpiderMonkey</a> 里,该字符串由日期部分(年月日)和其后的时间部分(时分秒及时区)组成。有时需要获取日期部分的字符串,这可以由 <code>toDateString</code> 方法完成。</p> <p>The <code>toDateString</code> method is especially useful because compliant engines implementing <a href="/en-US/docs/ECMAScript" title="ECMAScript">ECMA-262</a> may differ in the string obtained from <code>toString</code> for <code>Date</code> objects, as the format is implementation-dependent and simple string slicing approaches may not produce consistent results across multiple engines.</p> -<h2 id="Example" name="Example">例子</h2> +<h2 id="Example">例子</h2> -<h3 id="Example:_A_basic_usage_of_toDateString" name="Example:_A_basic_usage_of_toDateString">例子:<code>toDateString</code> 方法的简单使用</h3> +<h3 id="Example:_A_basic_usage_of_toDateString">例子:<code>toDateString</code> 方法的简单使用</h3> <pre class="brush:js">var d = new Date(1993, 6, 28, 14, 39, 7); @@ -61,7 +61,7 @@ println(d.toDateString()); // prints Wed Jul 28 1993</pre> <p>{{Compat("javascript.builtins.Date.toDateString")}}</p> -<h2 id="See_Also" name="See_Also">相关链接</h2> +<h2 id="See_Also">相关链接</h2> <ul> <li>{{jsxref("Date.prototype.toLocaleDateString()")}}</li> diff --git a/files/zh-cn/web/javascript/reference/global_objects/date/togmtstring/index.html b/files/zh-cn/web/javascript/reference/global_objects/date/togmtstring/index.html index 6891e3c04a..bacbfeb46a 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/date/togmtstring/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/date/togmtstring/index.html @@ -9,13 +9,13 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/toGMTString <p><strong>Note</strong>: <code>toGMTString</code> is deprecated and should no longer be used, it's only there for backwards compatibility, use {{jsxref("Date.toUTCString", "toUTCString()")}} instead.</p> -<h2 id="Syntax" name="Syntax">Syntax</h2> +<h2 id="Syntax">Syntax</h2> <pre class="syntaxbox"><var>dateObj</var>.toGMTString()</pre> -<h2 id="Examples" name="Examples">Examples</h2> +<h2 id="Examples">Examples</h2> -<h3 id="Example:_Using_toGMTString" name="Example:_Using_toGMTString">Example: Using <code>toGMTString</code></h3> +<h3 id="Example:_Using_toGMTString">Example: Using <code>toGMTString</code></h3> <p>In this example, the <code>toGMTString</code> method converts the date to GMT (UTC) using the operating system's time-zone offset and returns a string value that is similar to the following form. The exact format depends on the platform.</p> @@ -56,7 +56,7 @@ console.log(str); // Mon, 18 Dec 1995 17:28:35 GMT <p>{{Compat("javascript.builtins.Date.toGMTString")}}</p> -<h2 id="See_Also" name="See_Also">See also</h2> +<h2 id="See_Also">See also</h2> <ul> <li>{{jsxref("Date.prototype.toLocaleDateString()")}}</li> diff --git a/files/zh-cn/web/javascript/reference/global_objects/date/toisostring/index.html b/files/zh-cn/web/javascript/reference/global_objects/date/toisostring/index.html index ee2f6a29bb..83dec2f8b1 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/date/toisostring/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/date/toisostring/index.html @@ -11,7 +11,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/toISOString -<h2 id="Syntax" name="Syntax">语法</h2> +<h2 id="Syntax">语法</h2> <pre class="syntaxbox"><var>dateObj</var>.toISOString()</pre> @@ -23,7 +23,7 @@ alert(today.toISOString()); // 返回2011-10-05T14:48:00.000Z <p>上例使用了非标准字符串的解析,该字符串在某些旧的浏览器(如IE)中可能无法被正确解析。</p> -<h2 id="Description" name="Description">Polyfill</h2> +<h2 id="Description">Polyfill</h2> <p>该方法在ECMA-262第5版中被标准化。对于那些不支持此方法的JS引擎可以通过加上下面的代码实现:</p> @@ -78,7 +78,7 @@ alert(today.toISOString()); // 返回2011-10-05T14:48:00.000Z <p>{{Compat("javascript.builtins.Date.toISOString")}}</p> -<h2 id="See_Also" name="See_Also">相关链接</h2> +<h2 id="See_Also">相关链接</h2> <ul> <li>{{jsxref("Date.prototype.toLocaleDateString()")}}</li> diff --git a/files/zh-cn/web/javascript/reference/global_objects/date/tojson/index.html b/files/zh-cn/web/javascript/reference/global_objects/date/tojson/index.html index 91bc392260..917a1b4ffb 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/date/tojson/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/date/tojson/index.html @@ -11,18 +11,18 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/toJSON -<h2 id="Syntax" name="Syntax">语法</h2> +<h2 id="Syntax">语法</h2> <pre class="syntaxbox"><code><var>dateObj</var>.toJSON()</code> </pre> -<h2 id="Description" name="Description">描述</h2> +<h2 id="Description">描述</h2> <p>{{jsxref("Date")}} 实例引用一个具体的时间点。 调用 <code>toJSON()</code> 返回一个 JSON 格式字符串(使用 {{jsxref("Date.prototype.toISOString()", "toISOString()")}}),表示该日期对象的值。默认情况下,这个方法常用于 {{Glossary("JSON")}}序列化{{jsxref("Date")}}对象。</p> -<h2 id="Example" name="Example">样例</h2> +<h2 id="Example">样例</h2> -<h3 id="Example:_Using_toJSON" name="Example:_Using_toJSON"><code>toJSON()</code> 样例</h3> +<h3 id="Example:_Using_toJSON"><code>toJSON()</code> 样例</h3> <pre class="brush:js">var date = new Date(); console.log(date); //Thu Nov 09 2017 18:54:04 GMT+0800 (中国标准时间) diff --git a/files/zh-cn/web/javascript/reference/global_objects/date/tolocaledatestring/index.html b/files/zh-cn/web/javascript/reference/global_objects/date/tolocaledatestring/index.html index 407050f518..080fdffba4 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/date/tolocaledatestring/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/date/tolocaledatestring/index.html @@ -11,11 +11,11 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString -<h2 id="Syntax" name="Syntax">语法</h2> +<h2 id="Syntax">语法</h2> <pre class="syntaxbox"><var>dateObj</var>.toLocaleDateString([locales [, options]])</pre> -<h3 id="Parameters" name="Parameters">参数</h3> +<h3 id="Parameters">参数</h3> <p> 查看<a href="#Browser_Compatibility" title="#Browser_Compatibility">浏览器兼容性</a>小节,看下哪些浏览器支持 <code>locales</code> 和 <code>options</code> 参数,还可以参看<a href="#Example:_Checking_for_support_for_locales_and_options_arguments">例子: 检测 <code>locales</code> 和 <code>options</code> 参数支持情况</a>。</p> @@ -23,9 +23,9 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString <p>The default value for each date-time component property is <code>undefined</code>, but if the <code>weekday</code>, <code>year</code>, <code>month</code>, <code>day</code> properties are all <code>undefined</code>, then <code>year</code>, <code>month</code>, and <code>day</code> are assumed to be "numeric".</p> -<h2 id="Examples" name="Examples">例子</h2> +<h2 id="Examples">例子</h2> -<h3 id="Example:_Using_toLocaleDateString" name="Example:_Using_toLocaleDateString">例子:使用<code>toLocaleDateString</code></h3> +<h3 id="Example:_Using_toLocaleDateString">例子:使用<code>toLocaleDateString</code></h3> <p>没有指定语言环境(locale)时,返回一个使用默认语言环境和格式设置(options)的格式化字符串。</p> @@ -36,7 +36,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString date.toLocaleDateString(); // → "12/11/2012" if run in en-US locale with time zone America/Los_Angeles</pre> -<h3 id="Example:_Checking_for_support_for_locales_and_options_arguments" name="Example:_Checking_for_support_for_locales_and_options_arguments">例子:检测 <code>locales</code> 和 <code>options</code> 参数支持情况</h3> +<h3 id="Example:_Checking_for_support_for_locales_and_options_arguments">例子:检测 <code>locales</code> 和 <code>options</code> 参数支持情况</h3> <p><code>locales</code> 和 <code>options</code> 参数不是所有的浏览器都支持。为了检测一种实现环境(implementation)是否支持它们,可以使用不合法的语言标签,如果实现环境支持该参数,则会抛出一个 <code>RangeError</code> 异常,反之会忽略参数。</p> @@ -50,7 +50,7 @@ date.toLocaleDateString(); } </pre> -<h3 id="Example:_Using_locales" name="Example:_Using_locales">例子:使用<code>locales</code></h3> +<h3 id="Example:_Using_locales">例子:使用<code>locales</code></h3> <p>下例展示了本地化日期格式的一些变化。为了在应用的用户界面得到某种语言的日期格式,必须确保使用 <code>locales</code> 参数指定了该语言(可能还需要设置某些回退语言)。</p> @@ -86,7 +86,7 @@ alert(date.toLocaleDateString(["ban", "id"])); // → "20/12/2012" </pre> -<h3 id="Example:_Using_options" name="Example:_Using_options">例子:使用<code>options</code></h3> +<h3 id="Example:_Using_options">例子:使用<code>options</code></h3> <p>可以使用 <code>options </code>参数来自定义 <code>toLocaleDateString</code> 方法返回的字符串。</p> @@ -104,7 +104,7 @@ alert(date.toLocaleDateString("en-US", options)); // → "Thursday, December 20, 2012, GMT" </pre> -<h2 id="Performance" name="Performance">性能</h2> +<h2 id="Performance">性能</h2> <p>当格式化大量日期时,最好创建一个 <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat" title="/en-US/docs/JavaScript/Reference/Global_Objects/DateTimeFormat"><code>Intl.DateTimeFormat</code></a> 对象,然后使用该对象 <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/format" title="/en-US/docs/JavaScript/Reference/Global_Objects/DateTimeFormat/format"><code>format</code></a> 属性提供的方法。</p> @@ -144,7 +144,7 @@ alert(date.toLocaleDateString("en-US", options)); <p>{{Compat("javascript.builtins.Date.toLocaleDateString")}}</p> -<h2 id="See_Also" name="See_Also">相关链接</h2> +<h2 id="See_Also">相关链接</h2> <ul> <li>{{jsxref("Global_Objects/DateTimeFormat", "DateTimeFormat")}}</li> diff --git a/files/zh-cn/web/javascript/reference/global_objects/date/tolocalestring/index.html b/files/zh-cn/web/javascript/reference/global_objects/date/tolocalestring/index.html index a5b2885180..944af31c7e 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/date/tolocalestring/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/date/tolocalestring/index.html @@ -11,11 +11,11 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/toLocaleString -<h2 id="Syntax" name="Syntax">语法</h2> +<h2 id="Syntax">语法</h2> <pre class="syntaxbox"><var>dateObj.toLocaleString([locales [, options]])</var></pre> -<h3 id="Parameters" name="Parameters">参数</h3> +<h3 id="Parameters">参数</h3> <p>查看<a href="#Browser_Compatibility" title="#Browser_Compatibility">浏览器兼容性</a>小节,看下哪些浏览器支持 <code>locales</code> 和 <code>options</code> 参数,还可以参看<a href="#Example:_Checking_for_support_for_locales_and_options_arguments">例子:检测 <code>locales</code> 和 <code>options</code> 参数支持情况</a>。</p> @@ -27,9 +27,9 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/toLocaleString <p>根据当地语言规定返回代表着时间的字符串。</p> -<h2 id="Examples" name="Examples">例子</h2> +<h2 id="Examples">例子</h2> -<h3 id="Example:_Using_toLocaleString" name="Example:_Using_toLocaleString">例子:使用 <code>toLocaleString</code></h3> +<h3 id="Example:_Using_toLocaleString">例子:使用 <code>toLocaleString</code></h3> <p>没有指定语言环境(locale)时,返回一个使用默认语言环境和格式设置(options)的格式化字符串。</p> @@ -40,7 +40,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/toLocaleString date.toLocaleString(); // → 如果是在en-US区域和America/Los_Angeles时区运行返回值为"12/11/2012, 7:00:00 PM"</pre> -<h3 id="Example:_Checking_for_support_for_locales_and_options_arguments" name="Example:_Checking_for_support_for_locales_and_options_arguments">例子:检测 <code>locales</code> 和 <code>options</code> 参数支持情况</h3> +<h3 id="Example:_Checking_for_support_for_locales_and_options_arguments">例子:检测 <code>locales</code> 和 <code>options</code> 参数支持情况</h3> <p><code>locales</code> 和 <code>options</code> 参数不是所有的浏览器都支持。为了检测一种实现环境(implementation)是否支持它们,可以使用不合法的语言标签,如果实现环境支持该参数,则会抛出一个 <code>RangeError</code> 异常,反之会忽略参数。</p> @@ -54,7 +54,7 @@ date.toLocaleString(); } </pre> -<h3 id="Example:_Using_locales" name="Example:_Using_locales">例子:使用 <code>locales</code> 参数</h3> +<h3 id="Example:_Using_locales">例子:使用 <code>locales</code> 参数</h3> <p>下例展示了本地化日期格式的一些变化。为了在应用的用户界面得到某种语言的日期和时间格式,必须确保使用 <code>locales</code> 参数指定了该语言(可能还需要设置某些回退语言)。</p> @@ -88,7 +88,7 @@ alert(date.toLocaleString(["ban", "id"])); // → "20/12/2012 11.00.00" </pre> -<h3 id="Example:_Using_options" name="Example:_Using_options">例子:使用 <code>options</code> 参数</h3> +<h3 id="Example:_Using_options">例子:使用 <code>options</code> 参数</h3> <p>可以使用 <code>options </code>参数来自定义 <code>toLocaleString</code> 方法返回的字符串。</p> @@ -110,7 +110,7 @@ alert(date.toLocaleString("en-US", {hour12: false})); // → "12/19/2012, 19:00:00" </pre> -<h2 id="Performance" name="Performance">性能</h2> +<h2 id="Performance">性能</h2> <p>当格式化大量日期时,最好创建一个 <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat" title="/en-US/docs/JavaScript/Reference/Global_Objects/DateTimeFormat"><code>Intl.DateTimeFormat</code></a> 对象,然后使用该对象 <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/format" title="/en-US/docs/JavaScript/Reference/Global_Objects/DateTimeFormat/format"><code>format</code></a> 属性提供的方法。</p> @@ -150,7 +150,7 @@ alert(date.toLocaleString("en-US", {hour12: false})); <p>{{Compat("javascript.builtins.Date.toLocaleString")}}</p> -<h2 id="See_Also" name="See_Also">相关链接</h2> +<h2 id="See_Also">相关链接</h2> <ul> <li>{{jsxref("Global_Objects/DateTimeFormat", "DateTimeFormat")}}</li> diff --git a/files/zh-cn/web/javascript/reference/global_objects/date/tolocaletimestring/index.html b/files/zh-cn/web/javascript/reference/global_objects/date/tolocaletimestring/index.html index cf32bed733..f28a479d75 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/date/tolocaletimestring/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/date/tolocaletimestring/index.html @@ -11,11 +11,11 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString -<h2 id="Syntax" name="Syntax">语法</h2> +<h2 id="Syntax">语法</h2> <pre class="syntaxbox"><var>dateObj</var>.toLocaleTimeString([locales [, options]])</pre> -<h3 id="Parameters" name="Parameters">参数</h3> +<h3 id="Parameters">参数</h3> <p>查看<a href="#Browser_Compatibility" title="#Browser_Compatibility">浏览器兼容性</a>小节,看下哪些浏览器支持 <code>locales</code> 和 <code>options</code> 参数,还可以参看<a href="#Example:_Checking_for_support_for_locales_and_options_arguments">例子:检测 <code>locales</code> 和 <code>options</code> 参数支持情况</a>。</p> @@ -23,9 +23,9 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString <p>The default value for each date-time component property is <code>undefined</code>, but if the <code>hour</code>, <code>minute</code>, <code>second</code> properties are all <code>undefined</code>, then <code>hour</code>, <code>minute</code>, and <code>second</code> are assumed to be "numeric".</p> -<h2 id="Examples" name="Examples">例子</h2> +<h2 id="Examples">例子</h2> -<h3 id="Example:_Using_toLocaleTimeString" name="Example:_Using_toLocaleTimeString">例子:使用 <code>toLocaleTimeString</code></h3> +<h3 id="Example:_Using_toLocaleTimeString">例子:使用 <code>toLocaleTimeString</code></h3> <p>没有指定语言环境(locale)时,返回一个使用默认语言环境和格式设置(options)的格式化字符串。</p> @@ -36,7 +36,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString alert(date.toLocaleTimeString()); // → "7:00:00 PM" if run in en-US locale with time zone America/Los_Angeles</pre> -<h3 id="Example:_Checking_for_support_for_locales_and_options_arguments" name="Example:_Checking_for_support_for_locales_and_options_arguments">例子:检测 <code>locales</code> 和 <code>options</code> 支持情况</h3> +<h3 id="Example:_Checking_for_support_for_locales_and_options_arguments">例子:检测 <code>locales</code> 和 <code>options</code> 支持情况</h3> <p><code>locales</code> 和 <code>options</code> 参数不是所有的浏览器都支持。为了检测一种实现环境(implementation)是否支持它们,可以使用不合法的语言标签,如果实现环境支持该参数,则会抛出一个 <code>RangeError</code> 异常,反之会忽略参数。</p> @@ -50,7 +50,7 @@ alert(date.toLocaleTimeString()); } </pre> -<h3 id="Example:_Using_locales" name="Example:_Using_locales">例子:使用 <code>locales</code> 参数</h3> +<h3 id="Example:_Using_locales">例子:使用 <code>locales</code> 参数</h3> <p>下例展示了本地化时间格式的一些变化。为了在应用的用户界面得到某种语言的时间格式,必须确保使用 <code>locales</code> 参数指定了该语言(可能还需要设置某些回退语言)。</p> @@ -81,7 +81,7 @@ alert(date.toLocaleTimeString(["ban", "id"])); // → "11.00.00" </pre> -<h3 id="Example:_Using_options" name="Example:_Using_options">例子:使用 <code>options</code> 参数</h3> +<h3 id="Example:_Using_options">例子:使用 <code>options</code> 参数</h3> <p>可以使用 <code>options </code>参数来自定义 <code>toLocaleTimeString</code> 方法返回的字符串。</p> @@ -97,7 +97,7 @@ alert(date.toLocaleTimeString("en-US", {hour12: false})); // → "19:00:00" </pre> -<h2 id="Performance" name="Performance">性能</h2> +<h2 id="Performance">性能</h2> <p>当格式化大量日期时,最好创建一个 <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat" title="/en-US/docs/JavaScript/Reference/Global_Objects/DateTimeFormat"><code>Intl.DateTimeFormat</code></a> 对象,然后使用该对象 <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/format" title="/en-US/docs/JavaScript/Reference/Global_Objects/DateTimeFormat/format"><code>format</code></a> 属性提供的方法。</p> @@ -139,7 +139,7 @@ alert(date.toLocaleTimeString("en-US", {hour12: false})); <p>{{Compat("javascript.builtins.Date.toLocaleTimeString")}}</p> </div> -<h2 id="See_Also" name="See_Also">相关链接</h2> +<h2 id="See_Also">相关链接</h2> <ul> <li>{{jsxref("Global_Objects/DateTimeFormat", "DateTimeFormat")}}</li> diff --git a/files/zh-cn/web/javascript/reference/global_objects/date/tostring/index.html b/files/zh-cn/web/javascript/reference/global_objects/date/tostring/index.html index 274418bf39..80663da2f0 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/date/tostring/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/date/tostring/index.html @@ -11,15 +11,15 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/toString -<h2 id="Syntax" name="Syntax">语法</h2> +<h2 id="Syntax">语法</h2> <pre class="syntaxbox"><var>dateObj</var>.toString()</pre> -<h3 id="Parameters" name="Parameters">参数</h3> +<h3 id="Parameters">参数</h3> <p>无</p> -<h2 id="Description" name="Description">描述</h2> +<h2 id="Description">描述</h2> <p>{{jsxref("Date")}}对象覆盖了 {{jsxref("Object")}} 对象的 <code>toString() </code>方法;它不是继承自 {{jsxref("Object.prototype.toString()")}}。对于 {{jsxref("Date")}} 对象,<code>toString()</code> 方法返回一个表示该对象的字符串。</p> @@ -29,9 +29,9 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/toString <p><code>toString() </code>是通用函数。如果不是{{jsxref("Date")}}实例,则 返回"Invalid Date"。</p> -<h2 id="Examples" name="Examples">例子</h2> +<h2 id="Examples">例子</h2> -<h3 id="Example:_Using_toString" name="Example:_Using_toString">例子: 使用 <code>toString</code> 方法</h3> +<h3 id="Example:_Using_toString">例子: 使用 <code>toString</code> 方法</h3> <p>下例把一个{{jsxref("Date")}}对象的 <code>toString</code> 返回值赋给 <code>myVar:</code></p> @@ -78,7 +78,7 @@ myVar = x.toString(); // 把类似于下面格式的值赋给 myVar, <p>{{Compat("javascript.builtins.Date.toString")}}</p> </div> -<h2 id="See_Also" name="See_Also">相关链接</h2> +<h2 id="See_Also">相关链接</h2> <ul> <li>{{jsxref("Object.prototype.toString()")}}</li> diff --git a/files/zh-cn/web/javascript/reference/global_objects/date/totimestring/index.html b/files/zh-cn/web/javascript/reference/global_objects/date/totimestring/index.html index faa183e9cf..53cdaee185 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/date/totimestring/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/date/totimestring/index.html @@ -11,19 +11,19 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/toTimeString -<h2 id="Syntax" name="Syntax">语法</h2> +<h2 id="Syntax">语法</h2> <pre class="syntaxbox"><var>dateObj</var>.toTimeString()</pre> -<h2 id="Description" name="Description">描述</h2> +<h2 id="Description">描述</h2> <p>{{jsxref("Global_Objects/Date", "Date")}} 对象的实例引用一个具体的时间点。 调用 {{jsxref("Date.toString", "toString")}} 方法以美式英语和人类易读的形式,返回日期对象的格式化字符串。在 <a href="/en-US/docs/SpiderMonkey" title="SpiderMonkey">SpiderMonkey</a> 里,该字符串由日期部分(年月日)和其后的时间部分(时分秒和时区)组成。有时会需要获取时间部分的字符串,这可以由 <code>toTimeString</code> 方法完成。</p> <p>The <code>toTimeString</code> method is especially useful because compliant engines implementing <a href="https://developer.mozilla.org/en-US/docs/ECMAScript" title="ECMAScript">ECMA-262</a> may differ in the string obtained from <code>toString</code> for <code>Date</code> objects, as the format is implementation-dependent; simple string slicing approaches may not produce consistent results across multiple engines.</p> -<h2 id="Example" name="Example">例子</h2> +<h2 id="Example">例子</h2> -<h3 id="Example:_A_basic_usage_of_toTimeString" name="Example:_A_basic_usage_of_toTimeString">例子:<code>toTimeString</code> 方法的简单使用</h3> +<h3 id="Example:_A_basic_usage_of_toTimeString">例子:<code>toTimeString</code> 方法的简单使用</h3> <pre class="brush:js">var d = new Date(1993, 6, 28, 14, 39, 7); @@ -62,7 +62,7 @@ println(d.toTimeString()); // prints 14:39:07 GMT-0600 (PDT) <p>{{Compat("javascript.builtins.Date.toTimeString")}}</p> -<h2 id="See_Also" name="See_Also">相关链接</h2> +<h2 id="See_Also">相关链接</h2> <ul> <li>{{jsxref("Date.prototype.toLocaleTimeString()")}}</li> diff --git a/files/zh-cn/web/javascript/reference/global_objects/date/toutcstring/index.html b/files/zh-cn/web/javascript/reference/global_objects/date/toutcstring/index.html index 94caba73dd..4ec941d0db 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/date/toutcstring/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/date/toutcstring/index.html @@ -11,23 +11,23 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/toUTCString -<h2 id="Syntax" name="Syntax">语法</h2> +<h2 id="Syntax">语法</h2> <pre class="syntaxbox"><var>dateObj</var>.toUTCString()</pre> -<h3 id="Parameters" name="Parameters">返回值</h3> +<h3 id="Parameters">返回值</h3> <p>返回使用UTC时区表示给定日期的字符串</p> <p> </p> -<h2 id="Description" name="Description">描述</h2> +<h2 id="Description">描述</h2> <p><code>toUTCString</code> 的返回值是一个使用UTC时区的易读格式字符串。返回值的格式可能随平台而变化。通常返回值是一个 RFC-1123 格式的时间戳,这是一个 RFC-822 时间戳的小幅更新版。</p> -<h2 id="Examples" name="Examples">例子</h2> +<h2 id="Examples">例子</h2> -<h3 id="Example:_Using_toUTCString" name="Example:_Using_toUTCString">例子:使用<code>toUTCString</code></h3> +<h3 id="Example:_Using_toUTCString">例子:使用<code>toUTCString</code></h3> <pre>var today = new Date(); var UTCstring = today.toUTCString(); @@ -65,7 +65,7 @@ var UTCstring = today.toUTCString(); <p>{{Compat("javascript.builtins.Date.toUTCString")}}</p> -<h2 id="See_Also" name="See_Also">相关链接</h2> +<h2 id="See_Also">相关链接</h2> <ul> <li>{{jsxref("Date.prototype.toLocaleString()")}}</li> diff --git a/files/zh-cn/web/javascript/reference/global_objects/date/utc/index.html b/files/zh-cn/web/javascript/reference/global_objects/date/utc/index.html index 2ea01679de..ba2fdc8a6b 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/date/utc/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/date/utc/index.html @@ -15,11 +15,11 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/UTC -<h2 id="Syntax" name="Syntax">语法</h2> +<h2 id="Syntax">语法</h2> <pre class="syntaxbox"><code>Date.UTC(<em>year</em>,<em>month</em>[,<em>date</em>[,<em>hrs</em>[,<em>min</em>[,<em>sec</em>{{mediawiki.external(',<em>ms</em>')}}]]]]) </code></pre> -<h2 id="Parameters" name="Parameters">参数</h2> +<h2 id="Parameters">参数</h2> <dl> <dt><code>year</code></dt> @@ -38,7 +38,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/UTC <dd>0 到 999 之间的一个整数,表示毫秒。</dd> </dl> -<h2 id="Description" name="Description">描述</h2> +<h2 id="Description">描述</h2> <p><code>UTC</code> 方法接受以逗号隔开的日期参数,返回1970-1-1 00:00:00 UTC到指定的日期之间的毫秒数。</p> @@ -55,9 +55,9 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/UTC <p>由于 <code>UTC</code> 是 <code>Date</code>(日期对象)的一个静态方法,所以应该在 <code>Date </code>上直接调用,就像 <code>Date.UTC()</code>,而不要把它作为创建的日期对象的方法。</p> -<h2 id="Examples" name="Examples">例子</h2> +<h2 id="Examples">例子</h2> -<h3 id="Example:_Using_Date.UTC" name="Example:_Using_Date.UTC">例子:使用 <code>Date.UTC</code></h3> +<h3 id="Example:_Using_Date.UTC">例子:使用 <code>Date.UTC</code></h3> <p>下面的语句使用 UTC 时间代替本地时间创建了一个日期对象。</p> @@ -95,7 +95,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/UTC <p>{{Compat("javascript.builtins.Date.UTC")}}</p> -<h2 id="See_also" name="See_also">相关链接</h2> +<h2 id="See_also">相关链接</h2> <ul> <li>{{jsxref("Date.parse()")}}</li> diff --git a/files/zh-cn/web/javascript/reference/global_objects/date/valueof/index.html b/files/zh-cn/web/javascript/reference/global_objects/date/valueof/index.html index 2a441189e5..2b61fccc35 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/date/valueof/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/date/valueof/index.html @@ -16,15 +16,15 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/valueOf <div>{{EmbedInteractiveExample("pages/js/date-valueof.html")}}</div> -<h2 id="Syntax" name="Syntax">语法</h2> +<h2 id="Syntax">语法</h2> <pre class="syntaxbox"><code><var>dateObj</var>.valueOf()</code></pre> -<h3 id="Parameters" name="Parameters">返回值</h3> +<h3 id="Parameters">返回值</h3> <p>从1970年1月1日0时0分0秒(UTC,即协调世界时)到该日期的毫秒数。</p> -<h2 id="Description" name="Description">描述</h2> +<h2 id="Description">描述</h2> <p><code>valueOf</code> 方法返回以数值格式表示的一个 <code>Date</code> 对象的原始值,从1970年1月1日0时0分0秒(UTC,即协调世界时)到该日期对象所代表时间的毫秒数。</p> @@ -32,9 +32,9 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/valueOf <p>该方法通常在 JavaScript 内部被调用,而不是在代码中显式调用。</p> -<h2 id="Examples" name="Examples">例子</h2> +<h2 id="Examples">例子</h2> -<h3 id="Example:_Using_valueOf" name="Example:_Using_valueOf">使用 <code>valueOf()</code></h3> +<h3 id="Example:_Using_valueOf">使用 <code>valueOf()</code></h3> <pre class="brush:js">var x = new Date(56, 6, 17); var myVar = x.valueOf(); // assigns -424713600000 to myVar @@ -76,7 +76,7 @@ var myVar = x.valueOf(); // assigns -424713600000 to myVar <p>{{Compat("javascript.builtins.Date.valueOf")}}</p> -<h2 id="See_Also" name="See_Also">相关链接</h2> +<h2 id="See_Also">相关链接</h2> <ul> <li>{{jsxref("Object.prototype.valueOf()")}}</li> |