how to get unix time in js code example
Example 1: js timestamp
var timestamp = new Date().getTime();
Example 2: javasctipt unix timestamp from date
Math.round(new Date().getTime() / 1000).toString()
Example 3: nodejs current timestamp unix
Math.floor(+new Date() / 1000)
Example 4: get epoch timestamp js
Math.floor(Date.now() / 1000)
Example 5: node js unix timestamp
function getUnixTime() {
return (Date.now() / 1000) | 0;
}