133
2019-04-17 10:12:11 133阅读 0喜欢

第一种和第二种是获取了当前毫秒的时间戳 ,最后一种获取的时间戳是把毫秒改成000显示

//方法一
let timestamp = (new Date()).getTime();
console.log(timestamp); //1555466794193

//方法二
let timestamp2 = (new Date()).valueOf();
console.log(timestamp2); //1555466794195

//方法三
let timestamp3 = Date.parse(new Date());
console.log(timestamp3);//1555466794000
2019-04-16 13:59:20 30阅读 0喜欢
944访问人次
Camila Waz 2019-04-22 15:50:06