Digital Marketing

Get a timestamp in #JavaScript

On almost all current browsers you can use Date.now() to get the UTC timestamp in milliseconds;
To get the timestamp in seconds, you can use:

Math.floor(Date.now() / 1000)


> Date.now()
1608669466244
> Math.floor(Date.now() / 1000)
1608669474

Comments

Popular posts from this blog

Fixed WSL sshd: no hostkeys available -- exiting

PowerMTA pmta command

How to fix: mv: failed to preserve ownership