In this tutorial, we will see How To Get Timestamp In Javascript. As a software developer, you can’t run away from date manipulation. Almost every app a developer builds will have some component where date/time needs to be obtained from the user, stored in a database, and displayed back to the user. The UNIX timestamp is an integer that represents the number of seconds elapsed since January 1, 1970.
On UNIX-like machines, which include Linux and macOS, you can type the** date +%s** in the terminal and get the UNIX timestamp back.
You can fetch the current timestamp by calling now() method on Date object.
// app.js
console.log(Date.now());
#javascript #timestamp #macos #linux