Use JavaScript
Date
objects. Create two of them with the date/times you want, then use valueOf() to get the raw numbers (millisecs since epoch). Subtract them, so you have a time difference in millisecs. Divide by 1000 gives interval in secs. Divide again by 60 gives minutes... and so on...
See
here[
^] for some how-tos.