Skip to content

<time> - The Time Element

Inline HTML5

The time element represents a specific period in time or a duration. It provides a machine-readable datetime attribute while displaying human-readable content.

Result
<time datetime="machine-readable">human readable</time>

The datetime attribute contains an ISO 8601 formatted date/time that machines can parse.

AttributeDescriptionRequired
datetimeMachine-readable date/timeRecommended
Result
Result
Result
Result
Result
Result
Result
Result
Result
Result
Result
Result
Result
Result

Customize time element appearance:

Result
Result
FormatMeaningExample
PT#HHoursPT2H = 2 hours
PT#MMinutesPT30M = 30 minutes
PT#SSecondsPT45S = 45 seconds
PT#H#MHours and minutesPT2H30M = 2 hours 30 min
P#DDaysP7D = 7 days
P#MMonthsP3M = 3 months
P#YYearsP2Y = 2 years
Result
Result

The datetime attribute provides screen readers with precise temporal information.

<time datetime="2024-12-11">12/11/24</time>
<time datetime="2024-12-11" aria-label="December eleventh, two thousand twenty-four">
12/11/2024
</time>

Search engines use <time> to understand when content was published, helping with:

  • Freshness ranking
  • Timeline features
  • Knowledge graph
  • Rich snippets
BrowserVersionNotes
Chrome62+Full support
Firefox22+Full support
Safari7+Full support
Edge79+Full support
IENoNot supported

The <time> element is an HTML5 feature with good modern browser support.