Prev Demo
JavaScript
>
Settime() Method
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> </head> <body> <p>Click the below button to set the Time by adding the milliseconds.</p> <input type="button" value="Click" onclick="myDate()" /> <p id="myId"></p> <script> function myDate() { var A = new Date(); A.setTime(1844282527852); //*adding milliseconds & set date and time*// document.getElementById("myId").innerHTML = A; } </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output