Created by davebLinked to 91.6m issues across 63 teams
Date.now() method. This method returns the number of milliseconds since the Unix epoch. You can also use the unary operator
+ to call
+ new Date()
Or, you can call
To get the number of seconds since the Unix epoch (i.e., Unix timestamp), you can use
Math.floor(Date.now() / 1000). Alternatively, you can use bitwise-or to floor, which is slightly faster but less readable.
Date.now() / 1000 | 0