Hours Worked Time Sheet

Hours Worked Time Sheet

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?

  1.     startmin = (input.Start_Time.getHour()  *  60  +  input.Start_Time.getMinutes());
  2.     endmin = (input.End_Time.getHour()  *  60  +  input.End_Time.getMinutes());
  3.     input.Time_Taken = ((endmin  -  startmin)  /  60  -  input.Break_1  -  input.Break_2);
Thank you, Jonah