Home
<!DOCTYPE html> <html> <body> <h1>Demo: JavaScript Date Object</h1> <p id="p1"></p> <p id="p2"></p> <p id="p3"></p> <script> var date1 = new Date(0); var date2 = new Date(1000); var date3 = new Date(5000); document.getElementById("p1").innerHTML = date1; document.getElementById("p2").innerHTML = date2; document.getElementById("p3").innerHTML = date3; </script> </body> </html>
Result: