HTML DOM Input DatetimeLocal value property
Examples
Set Time field of local date and time:
document.getElementById("myLocalDate").value = "2014-01-02T11:42:13.510";
try it"
Definition and Usage
value attribute is used to set the property value or return value local time field.
value attribute describes the local date and time Time fields.
Browser Support
All major browsers support attribute value.
Note: Internet Explorer or Firefox browser does not support <input type = "datetime-local "> element.
grammar
Returns the value property:
datetimelocalObject .value
Set the value property:
datetimelocalObject .value=YYYY-MM-DDThh:mm:ss.ms
Property Value
value | description |
---|---|
YYYY-MM-DDThh: mm:ssTZD | It describes the date and time. Interpreted as follows:
|
technical details
return value: | String, indicating the date and time of the local time field |
---|
More examples
Examples
Get local date and time Time fields:
var x = document.getElementById("myLocalDate").value;
x The output is: 2014-11-16T15:25:33
try it"
Related Pages
HTML Reference Manual: HTML <the INPUT> value The property
Input DatetimeLocal objects