timestamp javascript in secondi
const ts = () => Math.floor(new Date().getTime() / 1000);
javascript ottenere timestamp
var currentTimeInSeconds=Math.floor(Date.now()/1000); //unix timestamp in seconds
var currentTimeInMilliseconds=Date.now(); // unix timestamp in milliseconds
come ottenere il timestamp in javascript di un oggetto date
new Date().getTime()
new Date().valueOf()
data e ora del nodo js unix
function getUnixTime() {
return (Date.now() / 1000) | 0;
}
data e ora corrente di nodejs
Math.floor(new Date() / 1000)