The front end Js time string to timestamp December 6, 2023 by William Turner No Comments var str='the 2020-10-20 12:00:00' new Date(str.replace(/-/g.'/')).getTime() // The current timestamp new Date().getTime() Copy the code