description & Usage
<time> tag is used to add machine-readable translation for computers or robots.
By using this tag we can:
- A human-readable value displayed in browsers (between the tags)
- A machine-readable equivalent of that value (in the datetime attribute)
Display them.
Consider the following example:
<p>
today is <time datetime="2022-09-13 00:00">Programmer's Day</time>
</p>
<data> tag is used for machine-readable non-temporal translations.
Notes
Note: The <time> tag is used to specify a time, date, hour or any temporal expression (like programmer's day).
Browser compatibility and Support
# | Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
<time> |
Attributes
Attributes | Values | Description |
---|---|---|
datetime |
datetime
|
en |
Global Attributes
The <time> tag supports the HTML Global Attributes.
Event Attributes
The <time> tag supports the HTML Event Attributes.