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.
Discussions

approximate-now: A faster Date.now() alternative
I’ve never seen Date.now() be a performance issue. What inspired this? More on reddit.com
🌐 r/javascript
25
1
December 25, 2020
What is the difference between Date.now and Date.getTime in Javascript and how timezone affects them? - Stack Overflow
I am trying to understand how creation of dates using Javascript on client and server both can affect query results when timezone of client and server can differ. On client side, I am using Date.now() to save timestamp information More on stackoverflow.com
🌐 stackoverflow.com
Date vs new Date in JavaScript - Stack Overflow
new Date creates a new Date object that you can modify or initialize with a different date while Date returns a string of the current date/time, ignoring its arguments. ... Check out JavaScript Date for a quick API reference and code test bed. You can see the Date() function called without ... More on stackoverflow.com
🌐 stackoverflow.com
javascript - Performance of Date.now() vs (new Date).getTime() - Stack Overflow
Sometimes it's preferable to keep some time tracking variable in a Date object format rather than as just a number of milliseconds, to have access to Date's methods without re-instantiating. In that case, Date.now() still wins over new Date() or the like, though only by about 20% on my Chrome ... More on stackoverflow.com
🌐 stackoverflow.com
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Date
Date - JavaScript | MDN - Mozilla
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!
January 22, 2022 - • 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 › jsref › jsref_now.asp
JavaScript Date now() Method
Date.now() returns the number of milliseconds since January 1, 1970.
🌐
W3Schools
w3schools.com › js › js_date_methods.asp
JavaScript Get 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 ·
🌐
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();"
Find elsewhere
🌐
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.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Date › now
Date.now() - JavaScript - MDN - Mozilla
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:
🌐
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
October 1, 2025 - 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.
🌐
W3Schools
w3schools.com › js › js_dates.asp
JavaScript Dates
February 4, 2026 - 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 - Mozilla
July 4, 2024 - 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()....
🌐
TheLinuxCode
thelinuxcode.com › home › difference between `new date()` and `date.now()` in javascript (and how to avoid timestamp bugs)
Difference Between `new Date()` and `Date.now()` in JavaScript (and How to Avoid Timestamp Bugs) – TheLinuxCode
July 10, 2025 - JavaScript Date tries to cover all of that with one object. That’s why new Date() is so convenient—and why it’s so easy to misuse. When I’m in a plain Date codebase, I mimic Temporal’s clarity with naming and boundaries: ... If you need a timestamp for storage, comparisons, IDs, cache expiry, or event payloads, I use Date.now() and name it with an Ms suffix.
🌐
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