<time> element represents a time and/or date.
This element is intended as a way to encode dates and times in a machine-readable format, so that user agents can offer to add event reminders such as birthdays and anniversaries, or any event scheduling for user's calendar.
The following table summarizes the usages context and the version history of this tag.
|Content:||Inline and text, but no descendant
|Start/End Tag:||Start tag: required, End tag: required|
|Version:||New in HTML5|
The basic syntax of the
<time> tag is given with:
The example below shows the
<time> tag in action.
ExampleTry this code »
<p>The library opens at <time>8:30 am</time> every morning.</p>
<p>The concert took place on <time datetime="2016-12-31 12:00">31 Dec</time>.</p>
The following table shows the attributes that are specific to the
||datetime||Specifies the time or date that the element represents.|
Like all other HTML tags, the
<time> tag supports the global attributes in HTML5.
<time> tag also supports the event attributes in HTML5.
<time> tag is supported in all major modern browsers.
See tutorial on: HTML Text Formatting.