L' elemento HTML <time> rappresenta un orario nell'arco delle 24 ore o una data precisa nel Calendario gregoriano (con informazioni facoltative su orario e fuso orario).
Questo elemento serve per presentare date e orari in un formato leggibile dal computer. Può essere utile ai motori di ricerca per fornire funzionalità di organizzazione di eventi e calendario.
- Content categoriesFlow content, phrasing content, palpable content.
- Permitted content Phrasing content, but no descendant
timeelements. - Tag omission None; both the starting and ending tags are mandatory.
- Permitted parent elements Any element that accepts phrasing content.
- DOM interface
HTMLTimeElement
Attributi
Come altri elementi HTML, questo elemento supporta gli attributi globali.
-
datetime - Questo attributo indica il tempo e la data dell'elemento e deve essere una stringa di data valida con tempo facoltativo. Se il valore non può essere interpretato come data con tempo facoltativo, l'elemento non ha un datestamp associato.
Esempi
Esempio semplice
<p>Il concerto inizia alle <time>20:00</time>.</p>
L'output del codice HTML in alto:
Il concerto inizia alle 20:00.
esempio datetime
<p>Il concerto si è svolto il <time datetime="2001-05-15 19:00">15 Maggio </time>.</p>
Above HTML will output:
Il concerto si è svolto il 15 Maggio.
Specifiche
| Specification | Status | Comment |
|---|---|---|
| HTML Living Standard The definition of '<time>' in that specification. |
Living Standard | No change from HTML 5.1 |
| HTML 5.1 The definition of '<main>' in that specification. |
Recommendation | No change from HTML5 |
| HTML5 The definition of '<main>' in that specification. |
Recommendation | Initial definition. |
Compatibilità browser
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|
| Basic support | No support | 22.0 (22.0) | ? | 11.50 Removed in 15.0 |
No support |
| Feature | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|---|
| Basic support | No support | No support | 22.0 (22.0) | ? | 11.50 Removed in 15.0 |
No support |
Vedi anche
- The
<data>element, allowing to signal other kind of values.

