ins dateTimeProperty
Examples
Returns the date and time when the text was inserted:
var x = document.getElementById("myIns").dateTime;
xThe output result is:
2012-09-15T22:55:03Z
Try it Yourself »
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 of the inserted or modified text.
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
Property Values
| Value | Description |
|---|---|
| YYYY-MM-DDThh:mm:ssTZD |
A date or time. The components are explained below:
|
Technical Details
| Return value: | A string, representing the date and time of an inserted text |
|---|
More Examples
Examples
Modify the datetime property value:
document.getElementById("myIns").dateTime="2013-11-15T21:40:07Z";
Try it Yourself »
Related Articles
HTML Reference Manual:HTML <ins> datetime Attribute
Other Extensions
ins Object