HTML DOM Time Object

Time Object

The Time Object is new in HTML5.

The Time object speaks to a HTML <time> element.

Access a Time Object

You can get to a <time> component by utilizing getElementsByTagName():

var x = document.getElementById("myTime"); Try it

Create a Time Object

You can make a <time> component by utilizing the document.createElement() method:

var x = document.createElement("TIME"); Try it

Time Object Properties

Property Description
dateTime Sets or returns the estimation of the datetime characteristic in a <time> element

Standard Properties and Events

The Time object additionally underpins the standard properties and events.

Related Pages

HTML reference: HTML <time> tag