There are several ways to get the current time in JavaScript:

  • new Date() creates a Date object representing current date/time
  • new Date().valueOf() returns number of milliseconds since midnight 01 January, 1970 UTC
  • new Date().getTime() Functionally equivalent to new Date().valueOf()
  • Date.now() Functionally equivalent to the 2 methods above

As mentioned in the comments and MDN links, Date.now() is not supported in Internet Explorer 8. So if IE 8 compatibility is a concern you should use new Date().valueOf() at the cost of slightly diminished code readability.

Or if you want to use Date.now() but must be compatible with browsers which don't support it, you can place following code somewhere in your JavaScript files, which will add support for it.

if (!Date.now) {
    Date.now = function() {
        return new Date().getTime();
    }
}
Answer from Bohuslav Burghardt on Stack Overflow
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › difference-between-new-date-and-datenow-in-javascript
Difference Between new Date() and Date.now() in JavaScript - GeeksforGeeks
August 5, 2025 - The Date.now() method returns the numeric value corresponding to the current time—the number of the milliseconds elapsed since January 1, 1970, 00:00:00 UTC.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Date
Date - JavaScript | MDN
The following examples show how to determine the elapsed time between two JavaScript dates in milliseconds. Due to the differing lengths of days (due to daylight saving changeover), months, and years, expressing elapsed time in units greater than hours, minutes, and seconds requires addressing a number of issues, and should be thoroughly researched before being attempted. ... // Using Date objects const start = Date.now(); // The event to time goes here: doSomethingForALongTime(); const end = Date.now(); const elapsed = end - start; // elapsed time in milliseconds
🌐
Medium
medium.com › @anandgupta20588 › date-now-vs-new-date-e744520ba762
Date.now() vs new Date. new Date: When you use new Date, it… | by Anandgupta | Medium
November 3, 2023 - Date.now() vs new Date new Date: When you use new Date, it creates a new Date object that represents the current date and time. It's an instance of the Date object containing not just the timestamp …
🌐
Sololearn
sololearn.com › en › Discuss › 2967337 › new-date-vs-datenow
new Date vs Date.now() | Sololearn: Learn to code for FREE!
• new Date() - creates a Date object representing the current date/time • Date.now() - returns the number of milliseconds since midnight 01 January, 1970 UTC As a matter of style, I found it clearer to use Date.now() in code that deals with intervals (usually subtracting an earlier date from a later date to calculate the time elapsed), and new Date() for timestamps, e.g.
🌐
W3Schools
w3schools.com › js › js_date_methods.asp
JavaScript Date Methods
The syntax is always Date.now(). UTC methods use UTC time (Coordinated Universal Time). UTC time is the same as GMT (Greenwich Mean Time). The difference between Local time and UTC time can be up to 24 hours. Local Time? UTC Time? The getTimezoneOffset() method returns the difference (in minutes) between local time an UTC time: let diff = d.getTimezoneOffset(); Try it Yourself » · JavaScript Date Tutorial ·
🌐
W3Schools
w3schools.com › jsref › jsref_now.asp
JavaScript Date now() Method
Date.now() returns the number of milliseconds since January 1, 1970.
🌐
GitHub
gist.github.com › cho45 › 5e2d40aa0e31f36f44b039259a3caa8b
Date.now() vs new Date().getTime() · GitHub
So, if it is just to just the content, it is better to use Date.now(). However, if you want to memorize this time, it can be easier to use something like "time = new Date().getTime();"
🌐
Reddit
reddit.com › r/javascript › approximate-now: a faster date.now() alternative
r/javascript on Reddit: approximate-now: A faster Date.now() alternative
December 25, 2020 - You see, if you call Date.now 6 million times, it takes 0.00001 seconds longer than the alternative method! ... OP develops a reasonably popular JSON logger. I'm guessing something came up that required this. Instead of embedding this in that library, he put it as a seperate package for anyone else doing large quantities of logging. ... If someone is calling Date.now() frequently enough to make it worthwhile to make it more efficient, they’re probably not going to want to sacrifice accuracy for it because there’d be no point in calling it so frequently.
Find elsewhere
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Date › now
Date.now() - JavaScript | MDN
The Date.now() static method returns the number of milliseconds elapsed since the epoch, which is defined as the midnight at the beginning of January 1, 1970, UTC.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Date › Date
Date() constructor - JavaScript | MDN
When no parameters are provided, the newly-created Date object represents the current date and time as of the time of instantiation. The returned date's timestamp is the same as the number returned by Date.now().
🌐
JavaScript.info
javascript.info › tutorial › the javascript language › data types
Date and time
Normally, dates start from 1, but technically we can pass any number, the date will autoadjust itself. So when we pass 0, then it means “one day before 1st day of the month”, in other words: “the last day of the previous month”. Open the solution with tests in a sandbox. ... Write a function getSecondsToday() that returns the number of seconds from the beginning of today. For instance, if now were 10:00 am, and there was no daylight savings shift, then:
🌐
W3Schools
w3schools.com › js › js_dates.asp
JavaScript Dates
JavaScript stores dates as number of milliseconds since January 01, 1970. Zero time is January 01, 1970 00:00:00 UTC. One day (24 hours) is 86 400 000 milliseconds. Now the time is: milliseconds past January 01, 1970
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Date › getTime
Date.prototype.getTime() - JavaScript | MDN
let end, start; start = new Date(); ... support the Performance API's high-resolution time feature, Performance.now() can provide more reliable and precise measurements of elapsed time than Date.now()....
🌐
Reddit
reddit.com › r/javascript › can you explain date.prototype.getdate() vs. date.now() in other words built-in object method differences
r/javascript on Reddit: Can you explain Date.prototype.getDate() vs. Date.now() in other words built-in object method differences
March 1, 2018 -

Redditors, Can someone please explain why (what is the reasoning/advantage)

below have direct methods

Date.UTC()
Date.now()
Date.parse()

And below have prototype methods

Date.prototype.getDate()
Date.prototype.getDay()

For testing:

const functionName = fn => (console.log(fn.name), fn);

functionName(Date.prototype.getDate); // logs getDate
functionName(Date.getDate); // logs Cannot read property     'name' of undefined
functionName(Date.now); // logs now
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › javascript-date-now-method
JavaScript Date now() Method - GeeksforGeeks
July 11, 2025 - The Date.now() method in JavaScript returns the current timestamp in milliseconds since January 1, 1970.
🌐
xjavascript
xjavascript.com › blog › date-new-date-date-valueof-vs-date-now
JavaScript: Date.now() vs new Date().valueOf() – Understanding the Difference for Getting Current Time
A Unix timestamp (also called an Epoch timestamp) is a numeric value representing the number of milliseconds (in JavaScript) since the Unix Epoch—January 1, 1970, 00:00:00 UTC. This standardized format makes it easy to compare, calculate, and store dates across systems. For example, the timestamp 1620000000000 corresponds to May 3, 2021, 12:00:00 UTC (your local time may vary based on time zone). Date.now() is a static method of JavaScript’s Date object.