Hi there,
I have two date fields that display hours and minutes with a 24 hour format. I need to calculate the difference in minutes.
example:
STARTTIME = “19:24” ENDTIME = “00:24”
I am currently using this formula which is giving me a negative number??? —> -1140
elapsed :=@Round(ENDTIME - STARTTIME)/60;
@Round(elapsed)
Any assistance is greatly appreciated.
Thanks!
Subject: Calculation of Minutes b/w 2 date fields
You need to divide by another 60.
Data-times in Formula language are stored as seconds, so subtracting the two, then dividing by 60*60 will give you Hours.
-1140/60 = -19 hours.
If you don’t want negatives, and you are guaranteed that the End-Time would only be on the day after the Start-Time, add a negative check, and add 24 if less then zero.
-19 +24 = 5 hours