Input DatetimeLocal value property
Example
Set the local date and time of the time field:
document.getElementById("myLocalDate").value = "2014-01-02T11:42:13.510";
Try it »
Definition and Usage
The value property is used to set or return the value of the value property 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 attribute.
**Note:** Internet Explorer or Firefox browser does not support .
Syntax
Return the value attribute:
datetimelocalObject
.value
Set the value attribute:
datetimelocalObject
.value=
YYYY-MM-DDThh:mm:ss.ms
Attribute values
| Value | Description |
|---|---|
| YYYY-MM-DDThh:mm:ssTZD | Describes the date and time. Parsed as follows:
|
Technical Details
| Return Value: | String representing the date and time of the local datetime field |
|---|
More examples
Example
Get the local date and time of the time field:
var x = document.getElementById("myLocalDate").value;
x
The output is:
2014-11-16T15:25:33
Try it »
Related pages
HTML Reference Manual: HTML value attribute
Input DatetimeLocal Object