How to render a date and time input field
_input elements of type datetime-local create input controls that let the user easily enter both a date and a time, including the year, month, and day as well as the time in hours and minutes.
The format of the date and time value used by this input type is YYYY-MM-DDThh:mm.
All other valid parameters for an input field are valid. Additionally you can use min, max and step.
<_label for="meeting-time">Choose a time for your appointment:</_label> <_input type="datetime-local" id="meeting-time" name="meeting-time" value="2022-03-01T10:00" min="2022-03-01T10:00" max="2022-03-01T18:00" />
The displayed date and time formats differ from the actual value; the displayed date and time are formatted according to the user's locale as reported by their operating system, whereas the date/time value is always formatted YYYY-MM-DDThh:mm.
For more information on this input type, see the link below.