
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
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
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