javascript时间戳以秒为单位
const ts = () => Math.floor(new Date().getTime() / 1000);
javasctipt unix时间戳从日期
Math.round(new Date().getTime() / 1000).toString()
如何在date对象的javascript中获取时间戳
new Date().getTime()
new Date().valueOf()
节点获取unix时间戳
Math.floor(new Date() / 1000) // in seconds
节点js unix时间戳
function getUnixTime() {
return (Date.now() / 1000) | 0;
}