Prop Ins Datetime
# ins dateTime Property
[ ins Object](#)
## Example
Return the date and time when the text was inserted:
var x = document.getElementById("myIns").dateTime;
The _x_ output will be:
2012-09-15T22:55:03Z
[Try it Yourself Β»](#)
* * *
## Definition and Usage
The dateTime property is used to set or return the value of the datetime attribute of an 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 a normal web browser, but can be used by screen readers.
* * *
## Browser Support

The dateTime property is supported by all major browsers.
* * *
## 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_ | Date or time. The components are explained below: * YYYY - Year (e.g. 2011) * MM - Month (e.g. 01 for January) * DD - Day (e.g. 08) * T - Required separator if time is specified * hh - Hour (e.g. 22 for 10.00pm) * mm - Minute (e.g. 55) * ss - Second (e.g. 03) * TZD - Time Zone Designator (Z indicates UTC, also known as Greenwich Mean Time) |
## Technical Details
| Return Value: | A String, representing the date and time of the inserted text |
| --- |
* * *
## More Examples
## Example
Change the datetime attribute value:
document.getElementById("myIns").dateTime="2013-11-15T21:40:07Z";
[Try it Yourself Β»](#)
## Related Articles
HTML Reference: [HTML datetime attribute](#)
* * ins Object](#)
YouTip