1 //字符串转成Time(dateDiff)所需方法
 2         function stringToTime(string) {
 3             var f = string.split(' ', 2);
 4             var d = (f[0] ? f[0] : '').split('-', 3);
 5             var t = (f[1] ? f[1] : '').split(':', 3);
 6             return (new Date(
 7             parseInt(d[0], 10) || null,
 8             (parseInt(d[1], 10) || 1) - 1,
 9             parseInt(d[2], 10) || null,
10             parseInt(t[0], 10) || null,
11             parseInt(t[1], 10) || null,
12             parseInt(t[2], 10) || null
13             )).getTime();
14         }

 

相关文章:

  • 2021-10-12
  • 2022-01-21
  • 2022-02-08
  • 2022-12-23
  • 2022-12-23
  • 2021-08-29
  • 2022-02-08
  • 2023-02-10
猜你喜欢
  • 2022-02-08
  • 2022-02-08
  • 2022-02-08
  • 2022-12-23
  • 2021-12-06
  • 2022-02-08
相关资源
相似解决方案