Esta tradução está incompleta. Ajude atraduzir este artigo.
Introduced in HTML5
Resumo
O elemento HTML time (<time>
) representa o tempo tanto no formato de 24 horas ou como uma data precisa no calendário Gregoriano (com informações opcionais de tempo e fuso horário)
Este elemento é destinado a apresentar datas e horas no dispositivo em um formato legível. Isto pode ser útil aos agentes do usuário em oferecer qualquer programação de eventos ao calendário do utilizador.
Usage context
Content categories | flow content, phrasing content |
Permitted content | Phrasing content, but no descendant time elements. |
Tag omission | None, both the start tag and the end tag are mandatory. |
Permitted parent elements | Any element that accepts phrasing content. |
Normative document | HTML5, section 4.6.10 |
Attributes
Like all other HTML elements, this element supports the global attributes.
datetime
- This attribute indicates the time and date of the element and must be a valid date with an optional time string. If the value cannot be parsed as a date with an optional time string, the element does not have an associated time stamp.
pubdate
- (This feature is still being discussed by the WHATWG and the W3C HTML5 Working Group.) This Boolean attribute specifies that the date and time given by the element is the publication date of a document. The document it applies to is either the nearest ancestor article element or the document as a whole (if there is no ancestor article element). If true, the
time
element must have a corresponding date. Additionally, eachtime
element indicating a publication date must be the onlytime
element that does so for that document.
DOM interface
This element implements the HTMLTimeElement
interface.
Examples
Simple example
<p>The concert starts at <time>20:00</time>.</p>
Above HTML will output:
The concert starts at 20:00.
pubdate
example
<article> <p>This article was created on <time pubdate>2011-01-28</time>.</p> </article>
Above HTML will output:
This article was created on 2011-01-28.
datetime
example
<p>The concert took place on <time datetime="2001-05-15 19:00">May 15</time>.</p>
Above HTML will output:
The concert took place on May 15.
Compatibility
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | ? | Não suportado bug 629801 | ? | 11.50 | ? |
Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | ? | Não suportado | ? | ? | ? |
See also
- The
time
element (HTML5 specification)