【js】把当前毫秒时间转换为时间戳


第一种方法   1498627266000

 var timestamp1 =Date.parse(new Date());
 console.log(timestamp1);

 

第二种方法   1498627266558

var timestamp2 =(new Date()).valueOf();
console.log(timestamp2);

 

第三种方法   1498627266558

var timestamp3 =new Date().getTime();
console.log(timestamp3);

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM