mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-08 23:14:06 +08:00
281 lines
21 KiB
HTML
281 lines
21 KiB
HTML
<article id="wikiArticle">
|
||
<div></div>
|
||
<div><strong><code>Intl.DateTimeFormat</code></strong>是根据语言来格式化日期和时间的对象的构造器。</div>
|
||
<div><iframe class="interactive interactive-js" frameborder="0" height="250" src="https://interactive-examples.mdn.mozilla.net/pages/js/intl-datetimeformat.html" width="100%"></iframe></div>
|
||
<p class="hidden">交互示例的源代码存储在 GitHub 资源库。如果你愿意分布交互示例,请复制<a class="external" href="https://github.com/mdn/interactive-examples" rel="noopener">https://github.com/mdn/interactive-examples</a>,并向我们发送一个pull请求。</p>
|
||
<h2 id="语法">语法</h2>
|
||
<pre><code class="language-javascript"><code>new Intl.DateTimeFormat([<var>locales</var>[, <var>options</var>]])
|
||
Intl.DateTimeFormat.call(<var>this</var>[, <var>locales</var>[, <var>options</var>]])</code></code></pre>
|
||
<h3 id="参数">参数</h3>
|
||
<dl>
|
||
<dt><code>locales</code></dt>
|
||
<dd>
|
||
<p>可选.缩写语言代码(BCP 47 language tag,例如:cmn-Hans-CN)的字符串或者这些字符串组成的数组. 关于参数locales的一般形式和解释请参见<a href="Reference/Global_Objects/Intl#Locale_identification_and_negotiation" title="Intl 对象是 ECMAScript 国际化 API 的一个命名空间,它提供了精确的字符串对比、数字格式化,和日期时间格式化。Collator,NumberFormat 和 DateTimeFormat 对象的构造函数是 Intl 对象的属性。本页文档内容包括了这些属性,以及国际化使用的构造器和其他语言的方法等常见的功能。">Intl page</a>. 下面的这些Unicode扩展键也是被允许的:</p>
|
||
<p>译者注:下面这两种扩展的使用方式是language[-scripts][-region]-u-nu-* 和 language[-scripts][-region]-u-ca-* ,例如:zh-u-nu-hanidec(表示中文十进制数字) 和 zh-u-ca-chinese(表示中国日历,比如壬辰年冬月8日) ,也可以 nu 和 ca 组合使用 比如 使用 zh-u-ca-chinese-nu-hanidec 格式化Date.now()的返回值类似于"丙申年冬月九日"</p>
|
||
<p><code>nu</code></p>
|
||
<dl>
|
||
<dd>编号系统. 可能的值包括: <code>"arab"</code>, <code>"arabext"</code>, <code>"bali"</code>, <code>"beng"</code>, <code>"deva"</code>, <code>"fullwide"</code>, <code>"gujr"</code>, <code>"guru"</code>, <code>"hanidec"</code>, <code>"khmr"</code>, <code>"knda"</code>, <code>"laoo"</code>, <code>"latn"</code>, <code>"limb"</code>, <code>"mlym"</code>, <code>"mong"</code>, <code>"mymr"</code>, <code>"orya"</code>, <code>"tamldec"</code>, <code>"telu"</code>, <code>"thai"</code>, <code>"tibt"</code>.</dd>
|
||
<dt><code>ca</code></dt>
|
||
<dd>日历. 可能的值包括: <code>"buddhist"</code>, <code>"chinese"</code>, <code>"coptic"</code>, <code>"ethioaa"</code>, <code>"ethiopic"</code>, <code>"gregory"</code>, <code>"hebrew"</code>, <code>"indian"</code>, <code>"islamic"</code>, <code>"islamicc"</code>, <code>"iso8601"</code>, <code>"japanese"</code>, <code>"persian"</code>, <code>"roc"</code>.</dd>
|
||
</dl>
|
||
</dd>
|
||
<dt><code>options</code></dt>
|
||
<dd>
|
||
<p>可选. 包含一些或所有的下面属性的类:</p>
|
||
<dl>
|
||
<dt><code>localeMatcher</code></dt>
|
||
<dd>使用的local的匹配算法. 可能的值有"lookup"和"best fit"; 默认值是 <code>"best fit"</code>. 有关此选项的信息, 请参见<a href="Reference/Global_Objects/Intl#Locale_negotiation" title="Intl 对象是 ECMAScript 国际化 API 的一个命名空间,它提供了精确的字符串对比、数字格式化,和日期时间格式化。Collator,NumberFormat 和 DateTimeFormat 对象的构造函数是 Intl 对象的属性。本页文档内容包括了这些属性,以及国际化使用的构造器和其他语言的方法等常见的功能。">Intl page</a>.</dd>
|
||
<dt><code>timeZone</code></dt>
|
||
<dd>使用的时区. 这唯一的值实现必须被标准世界时间(UTC)所识别。默认值是运行时的默认时区. <a class="external" href="https://www.iana.org/time-zones" rel="noopener">IANA time zone database</a>中的时区名称可能会被识别, 例如<code>"Asia/Shanghai"</code>, <code>"Asia/Kolkata"</code>, <code>"America/New_York"</code>.</dd>
|
||
<dt><code>hour12</code></dt>
|
||
<dd>是否使用12小时时间制(而不是24小时的时间). 可能的值是<code>true</code> 或 <code>false</code>; 默认值是根据locale来自动决定的(译者注:中国地区的默认值为true).</dd>
|
||
<dt><code>formatMatcher</code></dt>
|
||
<dd><code>format的匹配算法.可能的值有"basic"和"best fit";默认值是"best fit".有关此属性使用的信息,参见以下段落。</code></dd>
|
||
<dd>
|
||
<p>日期时间插件被格式化输出时可以使用的属性集合描述。实现需要支持是以下子集中的其中一个(译者注:当weekday,year等这些属性一个也不使用的时候,在cmn-Hans-CN中相当于使用集合year, month, day, hour, minute, second并且它们的值都是numeric):</p>
|
||
</dd>
|
||
</dl>
|
||
<ul>
|
||
<li><code>weekday</code>, <code>year</code>, <code>month</code>, <code>day</code>, <code>hour</code>, <code>minute</code>, <code>second</code></li>
|
||
<li><code>weekday</code>, <code>year</code>, <code>month</code>, <code>day</code></li>
|
||
<li><code>year</code>, <code>month</code>, <code>day</code></li>
|
||
<li><code>year</code>, <code>month</code></li>
|
||
<li><code>month</code>, <code>day</code></li>
|
||
<li><code>hour</code>, <code>minute</code>, <code>second</code></li>
|
||
<li><code>hour</code>, <code>minute</code></li>
|
||
</ul>
|
||
<p>实现可能支持其他的子集,并通过对所有可用的子集对比找到最匹配的子集。通过 formatMatcher属性可以设置两种算法用于对比和选择子集: <a class="external" href="http://www.ecma-international.org/ecma-402/1.0/#BasicFormatMatcher" rel="noopener">完全匹配<code>"basic"算法</code> </a> 和 一种依赖于“best fit”算法的实现.</p>
|
||
<dl>
|
||
<dt><code>weekday</code></dt>
|
||
<dd>工作日的展现方式.可能的值有 <code>"narrow"</code>, <code>"short"</code>, <code>"long"</code>.</dd>
|
||
<dt><code>era</code></dt>
|
||
<dd>纪元的展现方式. 可能的值有 <code>"narrow"</code>, <code>"short"</code>, <code>"long"</code>.</dd>
|
||
<dt><code>year</code></dt>
|
||
<dd>年的展现方式. 可能的值有 <code>"numeric"</code>, <code>"2-digit"</code>.</dd>
|
||
<dt><code>month</code></dt>
|
||
<dd>月的展现方式. 可能的值有 <code>"numeric"</code>, <code>"2-digit"</code>, <code>"narrow"</code>, <code>"short"</code>, <code>"long"</code>.</dd>
|
||
<dt><code>day</code></dt>
|
||
<dd>日的展现方式.可能的值有 <code>"numeric"</code>, <code>"2-digit"</code>.</dd>
|
||
<dt><code>hour</code></dt>
|
||
<dd>时的展现方式.可能的值有 <code>"numeric"</code>, <code>"2-digit"</code>.</dd>
|
||
<dt><code>minute</code></dt>
|
||
<dd>分钟的展现方式.可能的值有 <code>"numeric"</code>, <code>"2-digit"</code>.</dd>
|
||
<dt><code>second</code></dt>
|
||
<dd>秒的展现方式. 可能的值有<code>"numeric"</code>, <code>"2-digit"</code>.</dd>
|
||
<dt><code>timeZoneName</code></dt>
|
||
<dd>时区名称的展现方式.可能的值有 <code>"short"</code>, <code>"long"</code>.</dd>
|
||
</dl>
|
||
<p class="noinclude">每个日期时间组件属性的默认值都是<a href="Reference/Global_Objects/undefined" title="undefined是全局对象的一个属性。也就是说,它是全局作用域的一个变量。undefined的最初值就是原始数据类型undefined。"><code>undefined</code></a>,但是若所有的组件属性都是<a href="Reference/Global_Objects/undefined" title="undefined是全局对象的一个属性。也就是说,它是全局作用域的一个变量。undefined的最初值就是原始数据类型undefined。"><code>undefined</code></a>,那么<code>year</code>, <code>month</code>, and <code>day</code> 的值就都被认为是"<code>numeric</code>".</p>
|
||
</dd>
|
||
</dl>
|
||
<h2 id="描述">描述</h2>
|
||
<h3 id="属性">属性</h3>
|
||
<dl>
|
||
<dt><a href="Reference/Global_Objects/DateTimeFormat/prototype" title="Intl.DateTimeFormat.prototype表示 Intl.DateTimeFormat构造函数的原型对象。"><code>Intl.DateTimeFormat.prototype</code></a></dt>
|
||
<dd>允许将属性添加到所有对象上。</dd>
|
||
</dl>
|
||
<h3 id="方法">方法</h3>
|
||
<dl>
|
||
<dt><a class="new" href="Reference/Global_Objects/DateTimeFormat/supportedLocalesOf" rel="nofollow" title="此页面仍未被本地化, 期待您的翻译!"><code>Intl.DateTimeFormat.supportedLocalesOf()</code></a></dt>
|
||
<dd>Returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale.</dd>
|
||
</dl>
|
||
<h2 id="DateTimeFormat_实例"><code>DateTimeFormat</code> 实例</h2>
|
||
<h3 id="属性_2">属性</h3>
|
||
<p><code>DateTimeFormat实例集成以下原型的属性</code>:</p>
|
||
<div><dl>
|
||
<dt><code>Intl.DateTimeFormat.prototype.constructor</code></dt>
|
||
<dd>A reference to <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat" title="The Intl.DateTimeFormat object is a constructor for objects that enable language-sensitive date and time formatting."><code>Intl.DateTimeFormat</code></a>.</dd>
|
||
</dl></div>
|
||
<h3 id="方法_2">方法</h3>
|
||
<p><code>DateTimeFormat实例集成以下原型的方法</code>:</p>
|
||
<div><dl>
|
||
<dt><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/format" title="The Intl.DateTimeFormat.prototype.format() method formats a date according to the locale and formatting options of this Intl.DateTimeFormat object."><code>Intl.DateTimeFormat.prototype.format()</code></a></dt>
|
||
<dd>Getter function that formats a date according to the locale and formatting options of this <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat" title="The Intl.DateTimeFormat object is a constructor for objects that enable language-sensitive date and time formatting."><code>DateTimeFormat</code></a> object.</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/formatToParts" title="The Intl.DateTimeFormat.prototype.formatToParts() method allows locale-aware formatting of strings produced by DateTimeFormat formatters."><code>Intl.DateTimeFormat.prototype.formatToParts()</code></a></dt>
|
||
<dd>Returns an <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array" title="The JavaScript Array object is a global object that is used in the construction of arrays; which are high-level, list-like objects."><code>Array</code></a> of objects representing the date string in parts that can be used for custom locale-aware formatting.</dd>
|
||
<dt><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/resolvedOptions" title="The Intl.DateTimeFormat.prototype.resolvedOptions() method returns a new object with properties reflecting the locale and date and time formatting options computed during initialization of this DateTimeFormat object."><code>Intl.DateTimeFormat.prototype.resolvedOptions()</code></a></dt>
|
||
<dd>Returns a new object with properties reflecting the locale and formatting options computed during initialization of the object.</dd>
|
||
</dl></div>
|
||
<h2 id="实例">实例</h2>
|
||
<h3 id="使用_DateTimeFormat">使用 <code>DateTimeFormat</code></h3>
|
||
<p>不指定locale时,DateTimeFormat使用默认的locale 和 默认的 options</p>
|
||
<pre><code class="language-javascript">var date = new Date(Date.UTC(2012, 11, 20, 3, 0, 0));
|
||
|
||
//参数未填时使用默认的locale和默认的时区
|
||
console.log(new Intl.DateTimeFormat().format(date));
|
||
//如果是在洛杉矶那么值为 → "12/19/2012"
|
||
</code></pre>
|
||
<h3 id="使用locales">使用<code>locales</code></h3>
|
||
<p>这个例子显示了本地化日期和时间格式的一些变化。为了获得用于您的应用程序的用户界面的语言格式,请确保使用locales参数确保指定语言(可能还有一些回退语言):</p>
|
||
<pre><code class="language-javascript">var date = new Date(Date.UTC(2012, 11, 20, 3, 0, 0));
|
||
|
||
// 下面是假定的所在时区
|
||
// 洛杉矶(America/Los_Angeles for the US)
|
||
|
||
// 美式英语(US English) 使用 month-day-year 格式
|
||
console.log(new Intl.DateTimeFormat('en-US').format(date));
|
||
// → "12/19/2012"
|
||
|
||
// 英式英语(British English) 使用 day-month-year 格式
|
||
console.log(new Intl.DateTimeFormat('en-GB').format(date));
|
||
// → "20/12/2012"
|
||
|
||
// 韩国使用 year-month-day 格式
|
||
console.log(new Intl.DateTimeFormat('ko-KR').format(date));
|
||
// → "2012. 12. 20."
|
||
|
||
//大部分阿拉伯国家使用阿拉伯字母(real Arabic digits)
|
||
console.log(new Intl.DateTimeFormat('ar-EG').format(date));
|
||
// → "<span dir="rtl">٢٠/١٢/٢٠١٢</span>"
|
||
|
||
//在日本,应用可能想要使用日本日历,
|
||
//2012 是平成24年(平成是是日本天皇明仁的年号,由1989年1月8日起开始计算直至现在)
|
||
console.log(new Intl.DateTimeFormat('ja-JP-u-ca-japanese').format(date));
|
||
// → "平成24/12/20"
|
||
|
||
//当请求一个语言可能不支持,如巴厘(ban),若有备用的语言印尼语(id),
|
||
//那么将使用印尼语(id)
|
||
console.log(new Intl.DateTimeFormat(['ban', 'id']).format(date));
|
||
// → "20/12/2012"
|
||
</code></pre>
|
||
<h3 id="使用options">使用<code>options</code></h3>
|
||
<p>可以使用 <code>options </code>参数来自定义 <font face="Consolas, Liberation Mono, Courier, monospace">日期时间格式化</font>方法返回的字符串。</p>
|
||
<pre><code class="language-javascript">var date = new Date(Date.UTC(2012, 11, 20, 3, 0, 0));
|
||
|
||
//请求参数(options)中包含参数星期(weekday),并且该参数的值为长类型(long)
|
||
var options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
|
||
console.log(new Intl.DateTimeFormat('de-DE', options).format(date));
|
||
// → "Donnerstag, 20. Dezember 2012"
|
||
|
||
// 一个应用使用 世界标准时间(UTC),并且UTC使用短名字(short)展示
|
||
options.timeZone = 'UTC';
|
||
options.timeZoneName = 'short';//若不写这一行那么仍然显示的是世界标准时间;但是GMT三个字母不会显示
|
||
console.log(new Intl.DateTimeFormat('en-US', options).format(date));
|
||
// → "Thursday, December 20, 2012, GMT"
|
||
|
||
// 有时你想变得更精确
|
||
options = {
|
||
hour: 'numeric', minute: 'numeric', second: 'numeric',
|
||
timeZoneName: 'short'
|
||
};
|
||
console.log(new Intl.DateTimeFormat('en-AU', options).format(date));
|
||
// → "2:00:00 pm AEDT"
|
||
|
||
// 使用24小时制
|
||
options = {
|
||
year: 'numeric', month: 'numeric', day: 'numeric',
|
||
hour: 'numeric', minute: 'numeric', second: 'numeric',
|
||
hour12: false
|
||
};
|
||
console.log(date.toLocaleString('en-US', options));
|
||
// → "12/19/2012, 19:00:00"
|
||
</code></pre>
|
||
<h2 id="规范">规范</h2>
|
||
<table class="standard-table">
|
||
<tbody>
|
||
<tr>
|
||
<th scope="col">规范版本</th>
|
||
<th scope="col">规范状态</th>
|
||
<th scope="col">注解</th>
|
||
</tr>
|
||
<tr>
|
||
<td><a class="external" href="https://www.ecma-international.org/ecma-402/1.0/#sec-12.1" hreflang="en" lang="en" rel="noopener">ECMAScript Internationalization API 1.0 (ECMA-402)<br/><small lang="zh-CN">Intl.DateTimeFormat</small></a></td>
|
||
<td><span class="spec-Standard">Standard</span></td>
|
||
<td>Initial definition.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><a class="external" href="https://www.ecma-international.org/ecma-402/2.0/#sec-12.1" hreflang="en" lang="en" rel="noopener">ECMAScript Internationalization API 2.0 (ECMA-402)<br/><small lang="zh-CN">Intl.DateTimeFormat</small></a></td>
|
||
<td><span class="spec-Standard">Standard</span></td>
|
||
<td> </td>
|
||
</tr>
|
||
<tr>
|
||
<td><a class="external" href="https://tc39.github.io/ecma402/#datetimeformat-objects" hreflang="en" lang="en" rel="noopener">ECMAScript Internationalization API 4.0 (ECMA-402)<br/><small lang="zh-CN">Intl.DateTimeFormat</small></a></td>
|
||
<td><span class="spec-Draft">Draft</span></td>
|
||
<td> </td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h2 id="浏览器兼容性">浏览器兼容性</h2>
|
||
<div><div class="blockIndicator warning"><strong><a class="external" href="https://github.com/mdn/browser-compat-data" rel="noopener">We're converting our compatibility data into a machine-readable JSON format</a></strong>.
|
||
This compatibility table still uses the old format,
|
||
because we haven't yet converted the data it contains.
|
||
<strong><a class="new" href="/zh-CN/docs/MDN/Contribute/Structures/Compatibility_tables" rel="nofollow">Find out how you can help!</a></strong></div>
|
||
<div class="htab">
|
||
<a id="AutoCompatibilityTable" name="AutoCompatibilityTable"></a>
|
||
<ul>
|
||
<li class="selected"><a>Desktop</a></li>
|
||
<li><a>Mobile</a></li>
|
||
</ul>
|
||
</div></div>
|
||
<div id="compat-desktop">
|
||
<table class="compat-table">
|
||
<tbody>
|
||
<tr>
|
||
<th>Feature</th>
|
||
<th>Chrome</th>
|
||
<th>Firefox (Gecko)</th>
|
||
<th>Internet Explorer</th>
|
||
<th>Opera</th>
|
||
<th>Safari (WebKit)</th>
|
||
</tr>
|
||
<tr>
|
||
<td>Basic support</td>
|
||
<td>24</td>
|
||
<td><a href="/en-US/Firefox/Releases/29" title="Released on 2014-04-29.">29</a> (29)</td>
|
||
<td>11</td>
|
||
<td>15</td>
|
||
<td>10</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
<div id="compat-mobile">
|
||
<table class="compat-table">
|
||
<tbody>
|
||
<tr>
|
||
<th>Feature</th>
|
||
<th>Android</th>
|
||
<th>Chrome for Android</th>
|
||
<th>Firefox Mobile (Gecko)</th>
|
||
<th>IE Phone</th>
|
||
<th>Opera Mobile</th>
|
||
<th>Safari Mobile</th>
|
||
</tr>
|
||
<tr>
|
||
<td>Basic support</td>
|
||
<td><span style="color: #f00;">未实现</span></td>
|
||
<td>26</td>
|
||
<td><span style="color: #f00;">未实现</span></td>
|
||
<td><span style="color: #f00;">未实现</span></td>
|
||
<td><span style="color: #f00;">未实现</span></td>
|
||
<td>10</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
<h2 id="相关链接">相关链接</h2>
|
||
<div><ul>
|
||
<li>Introduction: <a class="external" href="http://norbertlindenberg.com/2012/12/ecmascript-internationalization-api/index.html" rel="noopener">The ECMAScript Internationalization API</a></li>
|
||
<li>Constructors
|
||
<ul>
|
||
<li><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Collator" title="The Intl.Collator object is a constructor for collators, objects that enable language sensitive string comparison."><code>Intl.Collator</code></a></li>
|
||
<li><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat" title="The Intl.DateTimeFormat object is a constructor for objects that enable language-sensitive date and time formatting."><code>Intl.DateTimeFormat</code></a></li>
|
||
<li><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/ListFormat" title="The Intl.ListFormat object is a constructor for objects that enable language-sensitive list formatting."><code>Intl.ListFormat</code></a></li>
|
||
<li><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/NumberFormat" title="The Intl.NumberFormat object is a constructor for objects that enable language sensitive number formatting."><code>Intl.NumberFormat</code></a></li>
|
||
<li><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/PluralRules" title="The Intl.PluralRules object is a constructor for objects that enable plural sensitive formatting and plural language rules."><code>Intl.PluralRules</code></a></li>
|
||
<li><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/RelativeTimeFormat" title="The Intl.RelativeTimeFormat object is a constructor for objects that enable language-sensitive relative time formatting."><code>Intl.RelativeTimeFormat</code></a></li>
|
||
</ul>
|
||
</li>
|
||
<li>Methods
|
||
<ul>
|
||
<li><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare" title="The localeCompare() method returns a number indicating whether a reference string comes before or after or is the same as the given string in sort order."><code>String.prototype.localeCompare()</code></a></li>
|
||
<li><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString" title="The toLocaleString() method returns a string with a language-sensitive representation of this number."><code>Number.prototype.toLocaleString()</code></a></li>
|
||
<li><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString" title="The toLocaleString() method returns a string with a language sensitive representation of this date. The new locales and options arguments let applications specify the language whose formatting conventions should be used and customize the behavior of the function. In older implementations, which ignore the locales and options arguments, the locale used and the form of the string returned are entirely implementation dependent."><code>Date.prototype.toLocaleString()</code></a></li>
|
||
<li><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString" title="The toLocaleDateString() method returns a string with a language sensitive representation of the date portion of this date. The new locales and options arguments let applications specify the language whose formatting conventions should be used and allow to customize the behavior of the function. In older implementations, which ignore the locales and options arguments, the locale used and the form of the string returned are entirely implementation dependent."><code>Date.prototype.toLocaleDateString()</code></a></li>
|
||
<li><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString" title="The toLocaleTimeString() method returns a string with a language sensitive representation of the time portion of this date. The new locales and options arguments let applications specify the language whose formatting conventions should be used and customize the behavior of the function. In older implementations, which ignore the locales and options arguments, the locale used and the form of the string returned are entirely implementation dependent."><code>Date.prototype.toLocaleTimeString()</code></a></li>
|
||
</ul>
|
||
</li>
|
||
</ul></div>
|
||
</article> |