I'm trying to calculate the difference (in seconds) between two EPOCH timestamps using Javascript.
I have two timestamps:
START: 1565628094441
END: 1565714527812
Both timestamps were obtained using:
var time = new Date().getTime().toString();
I would like to determine the difference between both timestamps in seconds. I understand that Javascript returns epoch in milliseconds but I still haven't been able to find a way to convert them to seconds properly.
Here is what I've tried:
var differenceSec = (END- START)/1000;
// This gives us 86433.371 Seconds (~1440 minutes).
Using Epoch Converter (https://www.epochconverter.com/#tools) I know that the true difference should be around 30 seconds. What am I doing wrong here?