Javascript Date() method returns today's date and time and does not need any object to be called.
Its syntax is as follows −
Date()
Returns today's date and time.
Try the following example.
<html> <head> <title>JavaScript Date Method</title> </head> <body> <script type = "text/javascript"> var dt = Date(); document.write("Date and Time : " + dt ); </script> </body> </html>