0
点赞
收藏
分享

微信扫一扫

js获取时间戳的三种方式

 

js获取时间戳的三种方式

CreateTime--2018年5月23日08:44:10

Author:Marydon 

// 方式一:推荐使用
var timestamp=new Date().getTime();
console.log(timestamp);
// 方式二
timestamp = (new Date()).valueOf();
console.log(timestamp);
// 方式三
timestamp = Date.parse(new Date());
console.log(timestamp);

效果展示

js获取时间戳的三种方式_JS

举报

相关推荐

0 条评论