I have a date in the following format: date: "2020-02-03T10: 00: 00";
Is there a way to calculate the difference between the current time - 2020-02-03T10: 00: 00?
Then I intend to start a timer that starts counting from the result. If the result is 30, I want the timer to start at 00:30:00, if it is 60, start 01:00:00.
Can someone help me?
code
data = [
{
date: "2020-02-03T10:00:00",
},
];
start(){
this.interval = setInterval(() => {
this.display = Date.now() - parseInt(this.data[0].date);
console.log(this.display)
}, 1000);
}