aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/javascript/reference/global_objects/date
diff options
context:
space:
mode:
Diffstat (limited to 'files/zh-cn/web/javascript/reference/global_objects/date')
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/date/date/index.html4
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/date/getdate/index.html4
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/date/getday/index.html8
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/date/gethours/index.html4
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/date/getmilliseconds/index.html4
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/date/getminutes/index.html4
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/date/getmonth/index.html4
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/date/getseconds/index.html8
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/date/gettimezoneoffset/index.html2
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/date/index.html18
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/date/parse/index.html14
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/date/setfullyear/index.html4
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/date/settime/index.html7
13 files changed, 39 insertions, 46 deletions
diff --git a/files/zh-cn/web/javascript/reference/global_objects/date/date/index.html b/files/zh-cn/web/javascript/reference/global_objects/date/date/index.html
index f97d377482..bc5f87a4aa 100644
--- a/files/zh-cn/web/javascript/reference/global_objects/date/date/index.html
+++ b/files/zh-cn/web/javascript/reference/global_objects/date/date/index.html
@@ -19,8 +19,8 @@ new Date(<var>dateString</var>)
new Date(<var>year</var>, <var>monthIndex</var> [, <var>day</var> [, <var>hours</var> [, <var>minutes</var> [, <var>seconds</var> [, <var>milliseconds</var>]]]]])
</pre>
-<div class="blockIndicator note">
-<p><strong>Note:</strong> The only correct way to instantiate a new <code>Date</code> object is by using the {{jsxref("new")}} operator. If you simply call the <code>Date</code> object directly, such as <code>now = Date()</code>, the returned value is a string rather than a <code>Date</code> object.</p>
+<div class="note">
+<p><strong>备注:</strong> The only correct way to instantiate a new <code>Date</code> object is by using the {{jsxref("new")}} operator. If you simply call the <code>Date</code> object directly, such as <code>now = Date()</code>, the returned value is a string rather than a <code>Date</code> object.</p>
</div>
<h3 id="Parameters">Parameters</h3>
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 7e7e429c3d..0e86ba5d6e 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
@@ -13,7 +13,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getDate
<h2 id="Syntax">语法</h2>
-<pre class="syntaxbox language-html">dateObj.getDate()</pre>
+<pre class="brush: js">dateObj.getDate()</pre>
<h2 id="Parameters">参数</h2>
@@ -29,7 +29,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getDate
<p>下面第二条语句将值25赋给 day 变量,该值基于日期对象 <code>Xmax95</code>的值。</p>
-<pre class="brush:js language-js">var Xmas95 = new Date("December 25, 1995 23:15:00");
+<pre class="brush:js">var Xmas95 = new Date("December 25, 1995 23:15:00");
var day = Xmas95.getDate();
alert(day); // 25</pre>
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 cc3a17b6c4..e299df4666 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
@@ -13,7 +13,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getDay
<h2 id="Syntax">语法</h2>
-<pre class="syntaxbox language-html"><em>dateObj</em>.getDay()
+<pre class="brush: js"><em>dateObj</em>.getDay()
</pre>
<h3 id="Description">返回值</h3>
@@ -26,13 +26,13 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getDay
<p>下面第二条语句,基于{{jsxref("Date")}}对象 <code>Xmas95</code> 的值,把 1 赋值给 <code>weekday</code>。也就是说1995年12月25日是星期一。</p>
-<pre class="brush:js language-js">var Xmas95 = new Date("December 25, 1995 23:15:30");
+<pre class="brush:js">var Xmas95 = new Date("December 25, 1995 23:15:30");
var weekday = Xmas95.getDay();
console.log(weekday); // 1</pre>
-<div class="blockIndicator note">
-<p>注意:如果需要,可以使用{{jsxref("DateTimeFormat", "Intl.DateTimeFormat")}}与一个额外的<code>options</code> 参数,从而返回这天的全称(如<code>"Monday"</code>).使用此方法,结果会更加国际化:</p>
+<div class="note">
+<p><strong>备注:</strong>如果需要,可以使用{{jsxref("DateTimeFormat", "Intl.DateTimeFormat")}}与一个额外的<code>options</code> 参数,从而返回这天的全称(如<code>"Monday"</code>).使用此方法,结果会更加国际化:</p>
<pre class="brush: js"><code>var options = { weekday: 'long'};
console.log(new Intl.DateTimeFormat('en-US', options).format(Xmas95));
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 2046e96d75..abd1ea2fd4 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
@@ -13,7 +13,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getHours
<h2 id="语法">语法</h2>
-<pre class="syntaxbox language-html"><var>dateObj</var>.getHours()</pre>
+<pre class="brush: js"><var>dateObj</var>.getHours()</pre>
<h3 id="Parameters">参数</h3>
@@ -29,7 +29,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getHours
<p>下面第二条语句,基于日期对象 <code>Xmas95 </code>的值,把 23 赋值给了变量 <code>hours。</code></p>
-<pre class="brush:js language-js">var Xmas95 = new Date("December 25, 1995 23:15:00");
+<pre class="brush:js">var Xmas95 = new Date("December 25, 1995 23:15:00");
var hours = Xmas95.getHours();
alert(hours); // 23</pre>
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 231cf2d7f9..40b3ac6eb5 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
@@ -13,7 +13,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getMilliseconds
<h2 id="Syntax">语法</h2>
-<pre class="syntaxbox language-html"><var>dateObj</var>.getMilliseconds()</pre>
+<pre class="brush: js"><var>dateObj</var>.getMilliseconds()</pre>
<h3 id="Parameters">参数</h3>
@@ -29,7 +29,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getMilliseconds
<p>下例中,将当前时间的毫秒数赋值给变量 <code>ms</code>。</p>
-<pre class="brush: js language-js">var ms;
+<pre class="brush: js">var ms;
Today = new Date();
ms = Today.getMilliseconds();</pre>
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 27adb1a179..7ebdff046e 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
@@ -11,7 +11,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getMinutes
<h2 id="Syntax">语法</h2>
-<pre class="syntaxbox language-html">dateObj.getMinutes()</pre>
+<pre class="brush: js">dateObj.getMinutes()</pre>
<h3 id="Parameters">参数</h3>
@@ -27,7 +27,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getMinutes
<p>下例中,第二行语句运行过后,变量 <code>minutes </code>的值为15,也就是说 <code>Xmas95 </code>这个日期对象的值为某时15分某秒。</p>
-<pre class="brush:js language-js">var Xmas95 = new Date("December 25, 1995 23:15:00");
+<pre class="brush:js">var Xmas95 = new Date("December 25, 1995 23:15:00");
var minutes = Xmas95.getMinutes();</pre>
<p><strong>规范</strong></p>
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 ce008a4ba0..f4baba5270 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
@@ -20,7 +20,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getMonth
<h2 id="Syntax">语法</h2>
-<pre class="syntaxbox language-html">dateObj.getMonth()</pre>
+<pre class="brush: js">dateObj.getMonth()</pre>
<h3 id="Parameters">参数</h3>
@@ -36,7 +36,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getMonth
<p>下面第二条语句,基于 {{jsxref("Date")}} 对象 Xmas95 的值,把11赋值给变量 <code>month。</code></p>
-<pre class="brush:js language-js">var Xmas95 = new Date('December 25, 1995 23:15:30');
+<pre class="brush:js">var Xmas95 = new Date('December 25, 1995 23:15:30');
var month = Xmas95.getMonth();
console.log(month); // 11</pre>
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 4543e5c2b2..dbd4590d22 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
@@ -13,7 +13,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getSeconds
<h2 id="Syntax">语法</h2>
-<pre class="syntaxbox language-html">dateObj.getSeconds()</pre>
+<pre class="brush: js">dateObj.getSeconds()</pre>
<h3 id="Parameters">参数</h3>
@@ -29,13 +29,9 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getSeconds
<p>下面第二条语句,基于日期对象 <code>Xmas95</code> 的值,把 30 赋值给变量 <code>secs</code>。</p>
-<pre class="brush:js language-js">var Xmas95 = new Date("December 25, 1995 23:15:30");
+<pre class="brush:js">var Xmas95 = new Date("December 25, 1995 23:15:30");
var secs = Xmas95.getSeconds();</pre>
-<div class="line-number"> </div>
-
-<div class="line-number"> </div>
-
<h2 id="规范">规范</h2>
<table class="standard-table">
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 7f2d81f94e..f85174cd35 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
@@ -13,7 +13,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getTimezoneOffset
<h2 id="Syntax">语法</h2>
-<pre class="syntaxbox language-html">dateObj.getTimezoneOffset()</pre>
+<pre class="brush: js">dateObj.getTimezoneOffset()</pre>
<h3 id="Parameters">参数</h3>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/date/index.html b/files/zh-cn/web/javascript/reference/global_objects/date/index.html
index d7dd9f80b5..19b33d4de4 100644
--- a/files/zh-cn/web/javascript/reference/global_objects/date/index.html
+++ b/files/zh-cn/web/javascript/reference/global_objects/date/index.html
@@ -24,7 +24,7 @@ new Date(<var>dateString</var>);
new Date(<var>year</var>, <var>monthIndex</var> [, <var>day</var> [, <var>hours</var> [, <var>minutes</var> [, <var>seconds</var> [, <var>milliseconds</var>]]]]]);</pre>
<div class="note">
-<p>创建一个新<code>Date</code>对象的唯一方法是通过{{jsxref("Operators/new", "new")}} 操作符,例如:<code>let now = new Date();</code><br>
+<p><strong>备注:</strong>创建一个新<code>Date</code>对象的唯一方法是通过{{jsxref("Operators/new", "new")}} 操作符,例如:<code>let now = new Date();</code><br>
若将它作为常规函数调用(即不加 {{jsxref("Operators/new", "new")}} 操作符),将返回一个字符串,而非 <code>Date</code> 对象。 </p>
</div>
@@ -41,10 +41,10 @@ new Date(<var>year</var>, <var>monthIndex</var> [, <var>day</var> [, <var>hours<
<dl>
<dt><code>value</code></dt>
<dd>一个 Unix 时间戳(<a href="http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_16">Unix Time Stamp</a>),它是一个整数值,表示自1970年1月1日00:00:00 UTC(the Unix epoch)以来的毫秒数,忽略了闰秒。请注意大多数 Unix 时间戳功能仅精确到最接近的秒。</dd>
- <dt><h4 id="时间戳字符串">时间戳字符串</h4><code>dateString</code></dt>
+ <dt>时间戳字符串 <code>dateString</code></dt>
<dd>表示日期的字符串值。该字符串应该能被 {{jsxref("Date.parse()")}} 正确方法识别(即符合 <a href="http://tools.ietf.org/html/rfc2822#page-14">IETF-compliant RFC 2822 timestamps</a> 或 <a href="http://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.15">version of ISO8601</a>)。
<div class="note">
- <p><strong>注意:</strong> 由于浏览器之间的差异与不一致性,强烈不推荐使用<code>Date</code>构造函数来解析日期字符串 (或使用与其等价的<code>Date.parse</code>)。对 RFC 2822 格式的日期仅有约定俗成的支持。 对 ISO 8601 格式的支持中,仅有日期的串 (例如 "1970-01-01") 会被处理为 UTC 而不是本地时间,与其他格式的串的处理不同。</p>
+ <p><strong>备注:</strong>由于浏览器之间的差异与不一致性,强烈不推荐使用<code>Date</code>构造函数来解析日期字符串 (或使用与其等价的<code>Date.parse</code>)。对 RFC 2822 格式的日期仅有约定俗成的支持。 对 ISO 8601 格式的支持中,仅有日期的串 (例如 "1970-01-01") 会被处理为 UTC 而不是本地时间,与其他格式的串的处理不同。</p>
</div>
</dd>
</dl>
@@ -73,15 +73,15 @@ new Date(<var>year</var>, <var>monthIndex</var> [, <var>day</var> [, <var>hours<
<h2 id="使用注释">使用注释</h2>
<div class="note">
-<p><strong>注意 参数</strong><code>monthIndex</code> 是从“0”开始计算的,这就意味着一月份为“0”,十二月份为“11”。</p>
+<p><strong>备注:</strong>参数<code>monthIndex</code> 是从“0”开始计算的,这就意味着一月份为“0”,十二月份为“11”。</p>
</div>
<div class="note">
-<p><strong>注意:</strong>当Date作为构造函数调用并传入多个参数时,如果数值大于合理范围时(如月份为 13 或者分钟数为 70),相邻的数值会被调整。比如 new Date(2013, 13, 1)等于new Date(2014, 1, 1),它们都表示日期2014-02-01(注意月份是从0开始的)。其他数值也是类似,new Date(2013, 2, 1, 0, 70)等于new Date(2013, 2, 1, 1, 10),都表示同一个时间:<code>2013-03-01T01:10:00</code>。</p>
+<p><strong>备注:</strong>当Date作为构造函数调用并传入多个参数时,如果数值大于合理范围时(如月份为 13 或者分钟数为 70),相邻的数值会被调整。比如 new Date(2013, 13, 1)等于new Date(2014, 1, 1),它们都表示日期2014-02-01(注意月份是从0开始的)。其他数值也是类似,new Date(2013, 2, 1, 0, 70)等于new Date(2013, 2, 1, 1, 10),都表示同一个时间:<code>2013-03-01T01:10:00</code>。</p>
</div>
<div class="note">
-<p><strong>注意:</strong>当Date作为构造函数调用并传入多个参数时,所定义参数代表的是当地时间。如果需要使用世界协调时 UTC,使用 <code>new Date({{jsxref("Date.UTC()", "Date.UTC(...)")}})</code> 和相同参数。</p>
+<p><strong>备注:</strong>当Date作为构造函数调用并传入多个参数时,所定义参数代表的是当地时间。如果需要使用世界协调时 UTC,使用 <code>new Date({{jsxref("Date.UTC()", "Date.UTC(...)")}})</code> 和相同参数。</p>
</div>
<h2 id="简介">简介</h2>
@@ -112,7 +112,7 @@ new Date(<var>year</var>, <var>monthIndex</var> [, <var>day</var> [, <var>hours<
<dt>{{jsxref("Date.parse()")}}</dt>
<dd>解析一个表示日期的字符串,并返回从 1970-1-1 00:00:00 所经过的毫秒数。
<div class="note">
- <p><strong>注意:</strong> 由于浏览器差异和不一致,强烈建议不要使用<code>Date.parse</code>解析字符串。</p>
+ <p><strong>备注:</strong> 由于浏览器差异和不一致,强烈建议不要使用<code>Date.parse</code>解析字符串。</p>
</div>
</dd>
<dt>{{jsxref("Date.UTC()")}}</dt>
@@ -141,7 +141,7 @@ new Date(<var>year</var>, <var>monthIndex</var> [, <var>day</var> [, <var>hours<
<p>下例展示了用来创建一个日期对象的多种方法。</p>
<div class="note">
-<p><strong>注意:</strong> 由于浏览器差异和不一致性,强烈建议不要使用<code>Date</code>构造函数(和<code>Date.parse</code>,它们是等效的)解析日期字符串。</p>
+<p><strong>备注:</strong> 由于浏览器差异和不一致性,强烈建议不要使用<code>Date</code>构造函数(和<code>Date.parse</code>,它们是等效的)解析日期字符串。</p>
</div>
<pre class="brush: js">var today = new Date();
@@ -197,7 +197,7 @@ yourFunctionReturn = printElapsedTime(yourFunction);
</pre>
<div class="note">
-<p>注意:在支持 {{domxref("window.performance", "Web Performance API")}} 的高精细度(high-resolution)时间功能的浏览器中,{{domxref("Performance.now()")}} 提供的所经过的时间比 {{jsxref("Date.now()")}} 更加可靠、精确。</p>
+<p><strong>备注:</strong>在支持 {{domxref("window.performance", "Web Performance API")}} 的高精细度(high-resolution)时间功能的浏览器中,{{domxref("Performance.now()")}} 提供的所经过的时间比 {{jsxref("Date.now()")}} 更加可靠、精确。</p>
</div>
<h3 id="获取自_Unix_起始时间以来经过的秒数">获取自 Unix 起始时间以来经过的秒数</h3>
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 eef2f86594..d479715f29 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
@@ -38,9 +38,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/parse
<h3 id="返回值">返回值</h3>
-<dl>
- <dd>一个表示从1970-1-1 00:00:00 UTC到给定日期字符串所表示时间的毫秒数的数值。如果参数不能解析为一个有效的日期,则返回{{jsxref("NaN")}}。</dd>
-</dl>
+<p>一个表示从1970-1-1 00:00:00 UTC到给定日期字符串所表示时间的毫秒数的数值。如果参数不能解析为一个有效的日期,则返回{{jsxref("NaN")}}。</p>
<h2 id="Description">描述</h2>
@@ -70,22 +68,22 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/parse
<p>但是, 在如 ECMA-262 规范中定义的情况,如果因为无效值而导致日期字符串不能被识别为 ISO 格式时,根据浏览器和给定的值不同,返回值可以是,也可以不是 {{jsxref("NaN")}} 。比如:</p>
-<pre class="brush: js line-numbers language-js">// 包含无效值的非 ISO 格式字符串
+<pre class="brush: js">// 包含无效值的非 ISO 格式字符串
new Date('23/25/2014');</pre>
<p>在 Firefox 30 中会被识别为本地时区的2015年12月25日,而在 Safari 7 中则是无效日期。但是,如果字符串被识别为 ISO 格式并且包含无效值,则在所有遵循 ES5 或者更新标准的浏览器中都会返回 {{jsxref("NaN")}} 。</p>
-<pre class="brush: js line-numbers language-js">// 包含无效值的 ISO 格式字符串
+<pre class="brush: js">// 包含无效值的 ISO 格式字符串
new Date('2014-25-23').toISOString();
// 在所有遵循 ES5的浏览器中返回 "RangeError: invalid date"</pre>
<p>SpiderMonkey 的引擎策略可以在 <a href="http://mxr.mozilla.org/mozilla-central/source/js/src/jsdate.cpp?rev=64553c483cd1#889"><code>jsdate.cpp</code></a>  中找到。字符串 <code>"10 06 2014"</code>  可以作为非 ISO 格式字符串使用自定义处理方式的例子。参见这篇关于解析如何进行的<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1023155#c6">粗略纲要</a>。</p>
-<pre class="brush: js line-numbers language-js">new Date('10 06 2014');</pre>
+<pre class="brush: js">new Date('10 06 2014');</pre>
<p>将会被解析为本地时间 2014年10月6日,而不是6月10日。另一个例子</p>
-<pre class="brush: js line-numbers language-js">new Date('foo-bar 2014').toString();
+<pre class="brush: js">new Date('foo-bar 2014').toString();
// 返回: "Invalid Date"
Date.parse('foo-bar 2014');
@@ -97,7 +95,7 @@ Date.parse('foo-bar 2014');
<p>如果 <code>IPOdate</code> 是一个已经存在的 {{jsxref("Date")}} 对象,则可以把其设置为本地时间 1995年8月9日。如下:</p>
-<pre class="brush: js line-numbers language-js">IPOdate.setTime(Date.parse('Aug 9, 1995'));</pre>
+<pre class="brush: js">IPOdate.setTime(Date.parse('Aug 9, 1995'));</pre>
<p>其他一些解析非标准格式日期的例子:</p>
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 5c85e43084..b2393680ba 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
@@ -13,7 +13,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/setFullYear
<h2 id="Syntax">语法</h2>
-<pre class="syntaxbox language-html">dateObj.setFullYear(yearValue[, monthValue[, dayValue]])</pre>
+<pre class="brush: js">dateObj.setFullYear(yearValue[, monthValue[, dayValue]])</pre>
<h3 id="Parameters">参数</h3>
@@ -36,7 +36,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/setFullYear
<h3 id="Example:_Using_setFullYear">例子:使用<code>setFullYear</code>方法</h3>
-<pre class="brush:js language-js">var theBigDay = new Date();
+<pre class="brush:js">var theBigDay = new Date();
theBigDay.setFullYear(1997);</pre>
<h2 id="规范">规范</h2>
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 ef3ce60645..28e6aee649 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
@@ -20,12 +20,11 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/setTime
<dl>
<dt><code>timeValue</code></dt>
<dd>一个整数,表示从1970-1-1 00:00:00 UTC开始计时的毫秒数。</dd>
- <dt>
- <h3 id="Parameters">返回值</h3>
- </dt>
- <dd>UTC 1970年1月1日00:00:00与更新日期之间的毫秒数(实际上是自变量的值)。</dd>
</dl>
+<h3 id="Parameters">返回值</h3>
+<p>UTC 1970年1月1日00:00:00与更新日期之间的毫秒数(实际上是自变量的值)。</p>
+
<h2 id="Description">描述</h2>
<p>使用 <code>setTime</code> 方法用来把一个日期时间赋值给另一个 <code>Date </code>对象。</p>