I have two timestamps in HH:mm format and I need to calculate difference between them representing the time interval in the same HH:mm format.
Is there any utility in JavaScript to achieve this? I tried using Date object, but I cannot find something useful… Can you help me?
You can just substract two Dates from one another, the result will be the difference in milliseconds.
From the Mozilla Developer Network:
Since Date has a constructor that accepts milliseconds as an argument, you can re-convert this to a Date by just doing