Open In App

JavaScript Date now() Method

Last Updated : 05 Mar, 2024
Like Article

The method in JavaScript returns the current timestamp in milliseconds since the Unix epoch (January 1, 1970, 00:00:00 UTC). is a static method of the Date object.

Date now() Method Syntax

let A =;

Date now() Method Parameters

This method does not accept any parameter. 

Date now() Method Return Values

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

Date now() Method Example

The below example illustrates the Date now() method.


// Use of method
let A =;
// Printing the number of millisecond elapsed
console.log("The time elapsed in millisecond is: " + A);


The time elapsed in millisecond is: 1702447051020


The code snippet utilizes `` 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.

Date now() Method Example:

This example illustrates getting the current date using the method.


// Use of method
let d = Date(;
// Converting the number of millisecond
// in date string
a = d.toString()
// Printing the current date
console.log("The current date is: " + a)


The current date is: Wed Dec 13 2023 05:57:31 GMT+0000 (Coordinated Universal Time)


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

Date now() Method UseCases

1. JavaScript Get Date Methods

JavaScript `getDate()` method retrieves the day of the month (1-31) from a Date object. It doesn’t require any parameters and returns the numeric value representing the day of the month.

2. How to Log the Current Date in JavaScript ?

 To log the current date in JavaScript, create a new Date object and call its toDateString() method, or use console.log(new Date().toDateString()).

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

Supported Browsers

Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads