HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
Time Object : Get the date that a <time> element represents
The dateTime property sets or returns the value of the datetime attribute in a <time> element.
The datetime attribute gives the date or time being specified. This attribute is used if no date or time is specified in the element's content.
Property | |||||
---|---|---|---|---|---|
datetime | Not supported | Not supported | Yes | Not supported | Not supported |
Return the dateTime property:
Set the dateTime property:
Value | Description |
---|---|
YYYY-MM-DDThh:mm:ssTZD | The date or time being specified. Explanation of components:
|
Return Value: | A String, representing a machine-readable form of the element's date and time |
---|
Change the date and time of a <time> element:
document.getElementById("myTime").dateTime = "1999-06-24T09:30Z";
HTML reference: HTML <time> datetime attribute
❮ Time Object