js current unix time code example
Example 1: nodejs current timestamp unix
Math.floor(+new Date() / 1000)
Example 2: get epoch timestamp js
Math.floor(Date.now() / 1000)
Example 3: node js unix timestamp
function getUnixTime() {
return (Date.now() / 1000) | 0;
}
Example 4: angular get current timestamp
var currentTimeInSeconds=Math.floor(Date.now()/1000); //unix timestamp in seconds
var currentTimeInMilliseconds=Date.now(); // unix timestamp in milliseconds