I put together this script for calculating for my time sheet. All hours worked are during the day.
Start_Time and End_Time are Date-Time fields. Break_1, Break_2, and Time_Taken are decimal fields.
This appears to calculate correctly, and meet my needs, but I want to check before implementing it.
Does anyone see any reason why this wont work?
- startmin = (input.Start_Time.getHour() * 60 + input.Start_Time.getMinutes());
- endmin = (input.End_Time.getHour() * 60 + input.End_Time.getMinutes());
- input.Time_Taken = ((endmin - startmin) / 60 - input.Break_1 - input.Break_2);
Thank you, Jonah