---
id: 587d778c367417b2b2512aa9
title: Standardizzare gli orari con l'attributo HTML5 datetime
challengeType: 0
videoUrl: 'https://scrimba.com/c/cmzMgtz'
forumTopicId: 301025
dashedName: standardize-times-with-the-html5-datetime-attribute
---
# --description--
Proseguendo con il tema della data, HTML5 ha introdotto l'elemento `time` insieme a un attributo `datetime` per standardizzare gli orari. L'elemento `time` è un elemento in linea che può avvolgere una data o un'ora in una pagina. Un attributo `datetime` contiene un formato valido di quella data. Questo è il valore accessibile alle tecnologie assistive. Esso aiuta ad evitare confusione fornendo una versione standardizzata di una data, anche se è scritta in modo informale o colloquiale nel testo.
Ecco un esempio:
```html
Master Camper Cat officiated the cage match between Goro and Scorpion , which ended in a draw.
```
# --instructions--
I risultati del sondaggio di Camper Cat sul torneo di Mortal Kombat sono arrivati! Metti un tag `time` intorno al testo `Thursday, September 15th` e aggiungi un attributo `datetime` impostato a `2016-09-15`.
# --hints--
Il tuo codice dovrebbe avere un elemento `p` che include il testo `Thank you to everyone for responding to Master Camper Cat's survey.` e che abbia un elemento `time`.
```js
assert(timeElement);
```
I tuoi tag `time` aggiuntivi dovrebbero avvolgere il testo `Thursday, September 15th`.
```js
assert(
timeElement &&
timeElement?.innerHTML?.trim() === 'Thursday, September 15th'
);
```
Il tuo tag `time` dovrebbe avere un attributo `datetime` non vuoto.
```js
assert(datetimeAttr && datetimeAttr?.length);
```
Il tuo attributo `datetime` dovrebbe essere impostato sul valore `2016-09-15`.
```js
assert(datetimeAttr === '2016-09-15');
```
# --seed--
## --after-user-code--
```html
```
## --seed-contents--
```html
Tournaments
Mortal Kombat Tournament Survey Results
Thank you to everyone for responding to Master Camper Cat's survey. The best day to host the vaunted Mortal Kombat tournament is Thursday, September 15th. May the best ninja win!
Comments:
Posted by: Sub-Zero on
Johnny Cage better be there, I'll finish him!
Posted by: Doge on
Wow, much combat, so mortal.
Posted by: The Grim Reaper on
Looks like I'll be busy that day.
```
# --solutions--
```html
Tournaments
Mortal Kombat Tournament Survey Results
Thank you to everyone for responding to Master Camper Cat's survey. The best day to host the vaunted Mortal Kombat tournament is . May the best ninja win!