xxxxxxxxxx
<input type="time">
#You should always use label for all inputs for accesssibility purposes.
<label for="picker">pick a time:</label>
<input type="time" id="picker" name="picker">
xxxxxxxxxx
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css">
</head>
<body>
<input type="text" id="datetimepicker">
<script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>
<script>
flatpickr('#datetimepicker', {
enableTime: true,
dateFormat: "Y-m-d H:i",
});
</script>
</body>
</html>
xxxxxxxxxx
Set the step attribute.
Ex: <input id="settime" type="time" step="1" />
document.getElementById("settime").value = "13:24:00";
<input id="settime" type="time" step="1" />