VOOZH about

URL: https://www.geeksforgeeks.org/javascript/javascript-date-now-method/

⇱ JavaScript Date now() Method - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

JavaScript Date now() Method

Last Updated : 11 Jul, 2025

The Date.now() method in JavaScript returns the current timestamp in milliseconds since January 1, 1970. This method doesn’t require creating a new date object, making it one of the fastest and most efficient ways to capture the current time in your code.

Syntax

let curr_date = Date.now();

Parameters

  • This method does not accept any parameter. 

Return Values

  • It returns the number of milliseconds elapsed since January 1, 1970, 00:00:00 UTC.

Different Examples of Date now() Method

Example 1: The below example of the Date now() method.


Output
The time elapsed in millisecond is: 1720904397838

Explanation:

The code snippet utilizes `Date.now()` to retrieve the current timestamp in milliseconds since the Unix epoch. It stores this value in variable `A` and prints it, indicating the elapsed milliseconds since the epoch.

Example 2: This example of getting the current date using the Date.now() method.


Output
The current date is: Sat Jul 13 2024 20:59:57 GMT+0000 (Coordinated Universal Time)

Explanation:

The code snippet generates a new Date object using the current timestamp from Date.now(). It then converts this date object to a string format using .toString() and logs it, displaying the current date and time.

We have a complete list of Javascript Date Objects, to check those please go through this article

Comment