

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
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
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)
- Related Questions & Answers
- How to get current date and time in JavaScript?
- Get current date/time in seconds - JavaScript?
- How to get current date and time in Python?
- How to get current time and date in C++?
- How do I get the current date and time in JavaScript?
- Get current time and date on Android
- How to get current date/time in seconds in JavaScript?
- How to get the current date and time in Java?
- How to print current date and time using Python?
- Java Program to Get Current Date/Time
- How to get current date and time from internet in android?
- How to get current date and time from internet in iOS?
- How to get the current local date and time in Kotlin?
- How to get the current time in millisecond using JavaScript?
- How can I get the current time and date in Kotlin?
Advertisements