
- Javascript Basics Tutorial
- Javascript - Home
- Javascript - Overview
- Javascript - Syntax
- Javascript - Enabling
- Javascript - Placement
- Javascript - Variables
- Javascript - Operators
- Javascript - If...Else
- Javascript - Switch Case
- Javascript - While Loop
- Javascript - For Loop
- Javascript - For...in
- Javascript - Loop Control
- Javascript - Functions
- Javascript - Events
- Javascript - Cookies
- Javascript - Page Redirect
- Javascript - Dialog Boxes
- Javascript - Void Keyword
- Javascript - Page Printing
- JavaScript Objects
- Javascript - Objects
- Javascript - Number
- Javascript - Boolean
- Javascript - Strings
- Javascript - Arrays
- Javascript - Date
- Javascript - Math
- Javascript - RegExp
- Javascript - HTML DOM
- JavaScript Advanced
- Javascript - Error Handling
- Javascript - Validations
- Javascript - Animation
- Javascript - Multimedia
- Javascript - Debugging
- Javascript - Image Map
- Javascript - Browsers
- JavaScript Useful Resources
- Javascript - Questions And Answers
- Javascript - Quick Guide
- Javascript - Functions
- Javascript - Resources
How to get current date and time in JavaScript?
To get current date and time in JavaScript, use the Date object.
Example
You can try to run the following code to display date and time −
<!DOCTYPE html> <html> <body> <p id="currentDate"></p> <script> document.getElementById("currentDate").innerHTML = Date(); </script> </body> </html>
- Related Articles
- How to get current date and time using JavaScript?
- How to get current date/time in seconds in JavaScript?
- Get current date/time in seconds - JavaScript?
- How do I get the current date and time in JavaScript?
- How to get current time and date in C++?
- How to get current date and time in Python?
- How to get the current date and time in Java?
- How to get current date and time from internet in iOS?
- How to get current date and time from internet in android?
- How to get the current local date and time in Kotlin?
- Get current time and date on Android
- Java Program to Get Current Date/Time
- How can I get the current time and date in Kotlin?
- How to get current date/time in milli seconds in Java?
- How to get the current date and time from the internet in Android using Kotlin?

Advertisements