首页 > Web开发 > 详细

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

时间:2020-01-08 10:54:08      阅读:323      评论:0      收藏:0      [点我收藏+]

第一种方法   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);

 

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

原文:https://www.cnblogs.com/whblogs/p/12165015.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!