Javascript examples for Date:setHours
Set the time to 15:35:01
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {/* w w w .ja v a2s .c om*/ var d = new Date(); d.setHours(15, 35, 1); document.getElementById("demo").innerHTML = d; } </script> </body> </html>