js时间字符串转时间戳

2,158 阅读1分钟
var str='2020-10-20 12:00:00'
new Date(str.replace(/-/g,'/')).getTime()
//当前时间戳
new Date().getTime()