Search code examples
htmltimesemantic-markup

What's the correct datetime format for a century in the HTML time element?


I wanted to use it to represent a century as a period of time, what would be a correct format for the datetime attribute using the HTML <time> element?

Example:

In the <time datetime="???">20th century</time> things changed a lot.

Correct me, please, if this is not a correct usage of the element.


Solution

  • This isn't what the time element is for. datetime must specify a specific point in time, or a specific duration of time. There's not a way to specify "100 years starting on this date".