Difference between 2 unix timestamps

Hi guys! I'm just wondering how i would go about calculating the difference between 2 unix timestamps and then displaying them in HH/MM/SS. I'm gonna have a look to see if there's any websites that i could use and just send the data to but would love to know what you guys come up with aswell!

here's an example
1 - 1638630398
2 - 1638630656

and i would be looking to get an output similar to

0 hours, 4 minutes, 18 seconds

Something like this might work:

t1: {formtext: name=t1; default=1638630398}
t2: {formtext: name=t2; default=1638630656}

Difference: {diff=t2-t1}

{=floor(diff/60/60)} hours, {=floor(remainder(diff, 60 * 60)/60)} minutes, {=remainder(diff, 60)} seconds

3 Likes

Thank you scott! I managed to get it working but this is definitely a lot clearer

1 Like