HTML time tag

The HTML time tag is used to represent date or time. The main advantage of using time tag is that it can also be used to encode date/time in machine-readable format so that the user agent can offer to add events and reminders.

HTML time tag

The HTML time tag is used to represent date or time. The main advantage of using time tag is that it can also be used to encode date/time in machine-readable format so that the user agent can offer to add events and reminders. This tag was introduced in HTML 5.

Attributes

The <time> tag supports all HTML Global attributes.

AttributeValue
datetimeThis attribute is used to specify date / time of the element.

Example

<p>John's birthday is on <time datetime="1987-04-10">10-April-1987</time></p>
<p>The meeting starts at <time>10:30</time> AM</p>

Output

John’s birthday is on 10-April-1987

The meeting starts at 10:30 AM


Share Tweet Send
Loading...
You've successfully subscribed to Geekinsta
Great! Next, complete checkout for full access to Geekinsta
Welcome back! You've successfully signed in
Success! Your account is fully activated, you now have access to all content.