3 回答
TA贡献1829条经验 获得超9个赞
短短的和时髦的:
+ new Date()
plus
valueOf
Date
详情:
Date.now()
if (!Date.now) { Date.now = function() { return new Date().getTime(); }}
Math.floor(Date.now() / 1000)
Date.now() / 1000 | 0
Date.now()
Date
new Date().getTime()
Math.round(new Date().getTime()/1000)
valueOf
new Date().valueOf()
时间戳(毫秒)
var timeStampInMs = window.performance && window.performance.now && window.performance.timing && window.performance.timing.navigationStart ? window.performance.now() + window.performance.timing.navigationStart : Date.now();
console.log(timeStampInMs, Date.now());
TA贡献1936条经验 获得超6个赞
var unix = Math.round(+new Date()/1000);
var milliseconds = new Date().getTime();
添加回答
举报