JS 获取当前时间的几种方式

版权声明:1.版权归原作者Moment ° 回忆 ✨所有; 2.未经原作者允许不得转载本文内容,否则将视为侵权; 3.转载或者引用本文内容请注明来源及原作者; 4.对于不遵守此声明或者其他违法使用本文内容者,本人依法保留追究权等。 https://blog.csdn.net/qq_35366269/article/details/88943053

方式一:

let time = Date.now();
console.log(time);
//1554086170985

方式二:

let timeTwo = new Date().getTime();
console.log(timeTwo);
1554086284317

猜你喜欢

转载自blog.csdn.net/qq_35366269/article/details/88943053