input type=datetime-local element | input type=datetime-local object
Creates a date and time entry control. This control is able to set date-time values (year, month, day, hour, minute, second).
DOM Information
Inheritance Hierarchy
Members
The input type=datetime-local object has these types of members:
Events
The input type=datetime-local object has these events.
| Event | Description |
|---|---|
| oninvalid |
Provides specified alert text if an input element is invalid. |
Remarks
Returns a date-time-formatted string containing a numeric representation of the year, month, day. and time e.g. 2015-02-15T13:00 for the date February 15th, 2015 and time 1:00 PM.
This control does not include time zone information.
A value's date and time must be separated by a literal string "T".
Milliseconds is not supported.
Examples
This example uses the input type=datetime-local type attribute to create a datetime-local control that is set to display "9/24/2015 12:00:30 PM".
<input type="datetime-local" value="2015-09-24T12:00:30">
See also
- Node
- Reference
- input
- validity
- formNoValidate