To provide option to user to select time, we can use
type attribute to time. Similarly, to provide option to select date and time both, we can use type attribute to datetime-local.
Despite the fact that datetime is also a valid
type value, it doesn't work in most of the browser.
<input type="time" name="myDateTime" id="myDateTime" />
Select Datetime Local:
<input type="datetime-local" name="myDateTimeLocal" id="myDateTimeLocal" />
There is slight difference between datetime and datetime-local type attribute value.