JavaScript · Dates and internationalisation

Date.now()

The current Unix timestamp in milliseconds. Useful for measuring elapsed time.

Syntax
Date.now()

Example

Try it

More in this group

Date arithmetic date.getFullYear() date.toISOString() date.toLocaleDateString() Intl.DateTimeFormat new Date()

Learn this in the course

Reference pages are the quick answer. The course explains the why, shows the full example and ends with a challenge.

Open the course