I need to compare two different datetime strings (formed: YYYY-MM-DD'T'HH:mm).
Here are the datetime strings:
var a = ("2017-05-02T10:45");
var b = ("2017-05-02T12:15");
I've sliced the dates out of them so I only need the time (formed: HH:mm).
var now = a.slice(11, 16);
var then = b.slice(11, 16);
// now = 10:45
// then = 12:15
Is there any way I could get the difference between these two times?
Result should look like this:
1 hour 30 minutes
Also if the dates are different is there any easy solution to get the date difference too?