![Date.now() Date.now()](https://geeks-news.com/wp-content/uploads/https://davidwalsh.name/wp-content/themes/punky/images/logo.png)
[ad_1]
Ask any software program engineer and so they’ll let you know that coding date logic is usually a nightmare. Builders want to think about timezones, bizarre date defaults, and platform-specific date codecs. The best technique to work with dates is to cut back the date to the simplest format attainable — normally a timestamp. To get the quick time in integer format, you should use Date.now
:
const now = Date.now(); // 1705190738870
I’ll oftentimes make use of Date.now()
in my console.log
statements to distinguish likewise console.log
outcomes from one another. You might additionally use that date as a novel identifier for an occasion in a low-traffic atmosphere.
The submit Date.now() appeared first on David Walsh Weblog.
[ad_2]