ins dateTimeProperty

ins 对象参考手册ins Object

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

Internet Explorer Firefox Opera Google Chrome Safari

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:

  • YYYY - year (e.g., 2011)
  • MM - month (e.g., 01 means January)
  • DD - day (e.g., 08)
  • T - a required separator if time is specified
  • hh - hour (e.g., 22 means 10.00pm)
  • mm - minute (e.g., 55)
  • ss - second (e.g., 03)
  • TZD - time zone designator (Z stands for Zulu, also known as Greenwich Mean Time)

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


ins 对象参考手册ins Object

Other Extensions