?
This document uses PHP Chinese website manual Release
HTML標(biāo)簽(<time>
)表示是在24小時(shí)的時(shí)鐘時(shí)間或在一個(gè)確切的日期公歷(帶有可選的時(shí)間和時(shí)區(qū)信息)。
內(nèi)容類別 | Flow content, phrasing content, palpable content. |
---|---|
允許的內(nèi)容 | Phrasing content. |
標(biāo)記遺漏 | 沒有; 起始和結(jié)束標(biāo)簽都是強(qiáng)制性的。 |
允許的父母 | 任何接受 phrasing content. 的元素。 |
允許ARIA角色 | 任何 |
DOM接口 | HTMLTimeElement |
像所有其他元素一樣,此元素?fù)碛锌梢允褂猛ㄓ脤傩浴?/p>
datetime
該屬性表示此元素的時(shí)間和日期,并且屬性值必須是一個(gè)有效的日期格式,并可包含時(shí)間。 如果此值不能被解析為日期,元素不會(huì)有一個(gè)關(guān)聯(lián)的時(shí)間戳.
此元素用于以機(jī)器可讀格式顯示日期和時(shí)間。例如,這可以幫助用戶代理提供將事件添加到用戶的日歷。
該元素不適用于無(wú)法計(jì)算特定日期的情況,也不適用于引入公歷之前的日期(由于計(jì)算這些日期的復(fù)雜性)。
<p>The concert starts at <time>20:00</time>.</p>
datetime
example<p>The concert took place on <time datetime="2001-05-15T19:00">May 15</time>.</p>
Specification | Status | Comment |
---|---|---|
HTML Living StandardThe definition of '<time>' in that specification. | Living Standard | No change from HTML 5.1 |
HTML 5.1The definition of '<time>' in that specification. | Recommendation | No change from HTML5 |
HTML5The definition of '<time>' in that specification. | Recommendation | Initial definition. |
Feature | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|---|
Basic Support | 62 | (Yes) | 22 | No | 49 11.5 — 12 | 7 |
datetime | 62 | (Yes) | 22 | No | 49 11.5 — 12 | 7 |
Feature | Android | Chrome for Android | Edge mobile | Firefox for Android | IE mobile | Opera Android | iOS Safari |
---|---|---|---|---|---|---|---|
Basic Support | 62 | 62 | (Yes) | 22 | No | 49 11.5 — 12 | 4 |
datetime | 62 | 62 | (Yes) | 22 | No | 49 11.5 — 12 | 4 |