Creates a control for selecting a date and time value. | HTML 5 |
HTML Syntax
<input type = datetime-local
[ min = yyyy-mm-ddThh-mm
max = yyyy-mm-ddThh-mm
value = yyyy-mm-ddThh-mm ]
>
NOTE: Only the <input
> start tag must be present. The element has no end tag.
The <input type=datetime-local
> element is used to create a control for selecting or entering a date and time ( year, month and day, as well as time in hours and minutes ).
The control renders in supporting browsers as a date and time picker, or as numeric wheels for year, month, day, plus time in hours and minutes.
The appearance of the date and time picker interface varies, based on the browser and operating system.
<input type=datetime-local
> may be specified with min and max attributes to restrict the dates and times that can be chosen by the user.
The control may also be specified with a value attribute, to set a default value for the input.
The selected and entered value includes the year, month, and day, plus the time in hours and minutes.
The submitted value is normalized to the format yyyy-mm-ddThh-mm.
The <input_datetime-local>
element supports the following attributes, in addition to global attributes and attributes common to all HTML input elements.
The following example shows how a simple <input type=datetime-local
> control renders on a web page.
<input type=datetime-local>
INPUT INPUT type=date INPUT type=month INPUT type=week