var str='the 2020-10-20 12:00:00'
new Date(str.replace(/-/g.'/')).getTime()
// The current timestamp
new Date().getTime()
Copy the code