I didn’t read the full post like I should-have.

The best library I have used for these types of calculations is Moment. There is a plugin available that can do that for you.

Ideally, you add in two parameters (the start and finish time), and it’ll output the time in between for you.