var time1 = Date.parse(new Date()) // Accurate to the second
var time2 = new Date().getTime() // Accurate to millisecond
var time3 = new Date().valueOf() // Accurate to millisecond
var time4 = Date.now() // Accurate to millisecond
var time5 = +new Date(a)// The time will be converted to number for calculation
console.log(time1) / / 1626430837000
console.log(time2) / / 1626430837152
console.log(time3) / / 1626430837152
console.log(time4) / / 1626430837152
console.log(time5) / / 1626430837152
Copy the code