mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2026-02-27 17:44:35 +08:00
语法高亮,滚动条美化,设置页面调整
This commit is contained in:
@@ -4,17 +4,17 @@
|
||||
<div><iframe class="interactive interactive-js" frameborder="0" height="250" src="https://interactive-examples.mdn.mozilla.net/pages/js/date-totimestring.html" width="100%"></iframe></div>
|
||||
<p class="hidden">The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone <a class="external" href="https://github.com/mdn/interactive-examples" rel="noopener">https://github.com/mdn/interactive-examples</a> and send us a pull request.</p>
|
||||
<h2 id="Syntax" name="Syntax">语法</h2>
|
||||
<pre class="syntaxbox"><var>dateObj</var>.toTimeString()</pre>
|
||||
<pre><code class="language-javascript"><var>dateObj</var>.toTimeString()</code></pre>
|
||||
<h2 id="Description" name="Description">描述</h2>
|
||||
<p><a href="Reference/Global_Objects/Date" title="The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request."><code>Date</code></a> 对象的实例引用一个具体的时间点。 调用 <a href="Reference/Global_Objects/Date/toString" title="toString() 方法返回一个字符串,表示该Date对象。"><code>toString</code></a> 方法以美式英语和人类易读的形式,返回日期对象的格式化字符串。在 <a href="/en-US/docs/SpiderMonkey" title="SpiderMonkey">SpiderMonkey</a> 里,该字符串由日期部分(年月日)和其后的时间部分(时分秒和时区)组成。有时会需要获取时间部分的字符串,这可以由 <code>toTimeString</code> 方法完成。</p>
|
||||
<p>The <code style="font-style: normal;">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 style="font-style: normal;">toString</code> for <code style="font-style: normal;">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>
|
||||
<h3 id="Example:_A_basic_usage_of_toTimeString" name="Example:_A_basic_usage_of_toTimeString">例子:<code>toTimeString</code> 方法的简单使用</h3>
|
||||
<pre class="brush:js">var d = new Date(1993, 6, 28, 14, 39, 7);
|
||||
<pre><code class="language-js">var d = new Date(1993, 6, 28, 14, 39, 7);
|
||||
|
||||
println(d.toString()); // prints Wed Jul 28 1993 14:39:07 GMT-0600 (PDT)
|
||||
println(d.toTimeString()); // prints 14:39:07 GMT-0600 (PDT)
|
||||
</pre>
|
||||
</code></pre>
|
||||
<h2 id="规范">规范</h2>
|
||||
<table class="standard-table">
|
||||
<tbody>
|
||||
|
||||
Reference in New Issue
Block a user