Favorites

JavaScript Date.now() Method

☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee
Date.now()
JavaScript Date Static methodThis method is supported by all modern browsers.
Updated 28th November 2026

The Date.now() static method returns the current time as the number of milliseconds since 1 January 1970 UTC.

Description

The Date.now() static method returns the current timestamp: milliseconds elapsed since the Unix epoch. It's quicker than new Date().getTime() and is handy for simple timing and for creating time-based values. For precise performance measurements, performance.now() is more accurate and isn't affected by changes to the system clock.

The value is in milliseconds; divide by 1000 and round down for the Unix timestamps in seconds that many APIs use. Browsers may reduce the precision of time values slightly as a privacy and security measure.

It's ideal for timestamps that will be stored or compared, such as cache expiry times: save Date.now() + 60000, and later check whether Date.now() has passed it.

Syntax

Date.now()

Return Value

The number of milliseconds since 1 January 1970 UTC.

Example

const start = Date.now();
console.log(start);
let x = 0;
for (let i = 0; i < 1e6; i++) x += i;
console.log('Took', Date.now() - start, 'ms');

Browser Support

The following information will show you the current browser support for the Date.now() method. Hover over a browser icon to see the version that first introduced support for this method.

This method is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported
☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee