【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);

 

posted @ 2020-01-08 09:53  WANGHUAN-  阅读(4202)  评论(1编辑  收藏  举报