 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to get current date and time using JavaScript?
To get current date and time using JavaScript, use the Date() method. JavaScript Date() method returns today's date and time and does not need any object to be called.
Example
You can try to run the following code to get current date and time −
<html>    <head>       <title>JavaScript Date Method</title>    </head>    <body>       <script>          var dt = Date();          document.write("Date and Time : " + dt );       </script>    </body> </html>  Output
Date and Time : Mon May 28 2018 10:16:33 GMT+0530 (India Standard Time)
Advertisements
 