Input DatetimeLocal valueProperty
Example
Set the local date and time of the time field:
document.getElementById("myLocalDate").value = "2014-01-02T11:42:13.510";
Try it yourself »
Definition and Usage
The value property is used to set or return the value of the value attribute of the local time field.
The value property describes the local date and time of the time field.
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the value property.
Note:Internet Explorer or Firefox do not support the <input type="datetime-local"> element.
Syntax
Return the value property:
datetimelocalObject.value
Set the value property:
datetimelocalObject.value=YYYY-MM-DDThh:mm:ss.ms
Property Values
| Value | Description |
|---|---|
| YYYY-MM-DDThh:mm:ssTZD | Describes the date and time. Parsed as follows:
|
Technical Details
| Return value: | A string representing the date and time of the local time field |
|---|
More Examples
Example
Get the local date and time of the time field:
var x = document.getElementById("myLocalDate").value;
xThe output is:2014-11-16T15:25:33
Try it yourself »
Related Pages
HTML Reference Manual:HTML <input> value Attribute
Input DatetimeLocal Object Other Extensions