js how to set a time on a date input code example Example: set date input html using js document.getElementById("datePicker").valueAsDate = new Date()