DateObject-2

 

In this example, We will set the date using new Date("December 13, 2015 11:13:00") function. See the code snippet:

 
 
 
<!DOCTYPE html> <html> <head> <title>Welcome to LearnKode - A code learning platform</title> </head> <body> <p id="sample"></p> <script> var date = new Date("December 13, 2015 11:13:00"); document.getElementById("sample").innerHTML = date; </script> </body> </html>
Output