javascript时间戳以秒为单位
const ts = () => Math.floor(new Date().getTime() / 1000);
javasctipt unix时间戳从日期
Math.round(new Date().getTime() / 1000).toString()
javascript获取时间戳
var currentTimeInSeconds=Math.floor(Date.now()/1000); //unix timestamp in seconds
var currentTimeInMilliseconds=Date.now(); // unix timestamp in milliseconds
nodejs当前时间戳unix
Math.floor(+new Date() / 1000)
节点js unix时间戳
function getUnixTime() {
return (Date.now() / 1000) | 0;
}