Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JavaScript Set the Hours, Minutes and Seconds Values of a Date Object</title> </head> <body> <script> let d = new Date(2018, 5, 24); // June 24, 2018 00:00:00 d.setHours(8); d.setMinutes(30); d.setSeconds(45); d.setMilliseconds(600); document.write(d); </script> </body> </html>