English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
O tag <time> do HTML ( <time>) é usado para representar24Hora ou data calendária, se for uma data, também pode incluir tempo e fuso horário. Este elemento tem a intenção de representar datas e horários em um formato legível por máquina. Aplicações com funcionalidades de agendamento podem aproveitar isso.
Como definir datas e horários:
!doctype html> <html> <head> <title>HTML5 uso do tag <time> (Tutorial básico da web oldtoolbag.com)</title> <meta charset="UTF-8"> </head> <body> <article> <h1>Título do artigo</h1> <p>Texto que aparece sob article</p> </article> <footer> <p>Este artigo foi publicado em <time>2019-12-28</time>.</p> <p>Nossa empresa abre às <time>08:30</time>.</p> </footer> </body> </html>Teste para ver ‹/›
Browsers supported by <time>:
IEFirefoxOperaChromeSafari
The <time> tag defines the Gregorian calendar time (24 hour system) or date, and the time zone offset is optional.
This element can encode dates and times in a machine-readable way, so that, for example, user agents can add birthday reminders or scheduled events to the user's schedule, and search engines can generate more intelligent search results.
<time> tag is HTML5 new tags.
New: HTML5 new attributes.
Attribute | Value | Description |
---|---|---|
datetimeHTML5 | datetime | Specify the date/Time. Alternatively, the date can be given by the content of the element/Time. |
pubdate | datetime | (This attribute is still being considered by WHATWG and W3(indicating the date within the <time> element). / Time is the publication date of the document (or the nearest ancestor <article> element) |
<time> tag support HTML global attributes.
<time> tag support HTML event attributes.