How do you get seconds for a time format like "Fri, 13 Apr 2018 17:06:57 GMT"?

how to get seconds for a time format like "Fri, 13 Apr 2018 17:06:57 GMT"
I need to compare the time difference new Date (). GetTime () with the current time

Mar.03,2021

let time = new Date("Fri, 13 Apr 2018 17:06:57 GMT").getTime() - new Date().getTime()
console.log(time)

convert to Date in comparison

  

"Fri, 13 Apr 2018 17:06:57 GMT" is an instance of a Date object
getTime () can get a timestamp
you can directly subtract two Date.getTime () and get the interval milliseconds

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e9e36f-19bd.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e9e36f-19bd.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?