Forum Academy Marketplace Showcase Pricing Features

Displaying the time between 2 times

Anyone know how to display the time between 2 dates?

Ex: User clocked in at 12:43 PM
User clocked out at 4:19 PM
Total time would be: 3hrs 36mins (and it would display formatted as HH:MM)

Anyone help is appreciated! Thank you!

Discord: daonlyryry#2571

Hi there, @ryaavr25… you can subtract one date/time from another date/time to get the difference between them, and you can format the result as days, hours, minutes, or seconds. So, if you have fields where you are storing the date/time when a user clocked in and out, you could have another field where the value is calculated by subtracting the former from the latter and then format the output to get the desired result (HH:MM).

Hope this helps.

Best…
Mike

Tysm! I’ll get back to you when I get home and try it! Once again thank you!

1 Like

My pleasure! If it helps, here is an example where I have two date inputs (one called clock in time and one called clock out time), and I am calculating the hours and minutes between the two inputs (using the :floor and <-modulo-> options, respectively) in a text field like this…

timecalc

Good luck!

Best…
Mike

It worked, thank you so so much!!

1 Like