diff options
Diffstat (limited to 'files/zh-cn/web/javascript/reference/global_objects/date/todatestring/index.html')
-rw-r--r-- | files/zh-cn/web/javascript/reference/global_objects/date/todatestring/index.html | 10 |
1 files changed, 5 insertions, 5 deletions
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> |