xxxxxxxxxx
var currentTimeInSeconds=Math.floor(Date.now()/1000); //unix timestamp in seconds
var currentTimeInMilliseconds=Date.now(); // unix timestamp in milliseconds
xxxxxxxxxx
const currentTimeInMilliseconds=Date.now(); // unix timestamp in milliseconds
xxxxxxxxxx
var timestamp = new Date().getTime();
console.log(timestamp);
xxxxxxxxxx
// Get current timestamp in milliseconds
const timestamp = Date.now();
console.log(timestamp);