One of hundreds of answers available with our premium content service.
A: There are two elements to this question, first to find the difference between two dates and second to format the result. The code below creates three variables to represent time intervals in milliseconds, then creates two dates with specific times on the same day. This could be adapted for any two dates, including the current time using the basic Date() constructor.
… full answer hidden
Premium members click below for full answer
How do I get the difference between two dates in Javascript?
We love social media, but we do not expect you to create yet another public outpost on the Web.