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获取时间戳的三种方式

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-05-31
  • 2021-10-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-29
猜你喜欢
  • 2022-02-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-03-10
  • 2021-08-10
相关资源
相似解决方案