ins dateTime property
Example
Return the date and time when the text was inserted:
var x = document.getElementById("myIns").dateTime;
x The output result is:
2012-09-15T22:55:03Z
Try it »
Definition and usage
The dateTime property sets or returns the value of the datetime attribute of the inserted text.
The datetime attribute defines the date and time when the text was inserted or modified.
Note: The dateTime property has no visual effect in ordinary web browsers but can be used by screen readers.
Browser support

All major browsers support the dateTime property.
Syntax
Return the dateTime property:
insObject
.dateTime
Set the dateTime property:
insObject
.dateTime=
YYYY-MM-DDThh:mm:ssTZD
Attribute values
| Value | Description |
|---|---|
| YYYY-MM-DDThh:mm:ssTZD |
Date or time. The components are explained below: |
Technical description
| Return value: | String, representing the date and time of the inserted text |
|---|
More examples
Example
Modify the datetime attribute value:
document.getElementById("myIns").dateTime="2013-11-15T21:40:07Z";
Try it »
Related Articles
HTML Reference Manual: HTML datetime property
ins Object