JavaScript Date.now() Method
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
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.
Desktop





Tablets & Mobile





