3 Replies Latest reply on Oct 13, 2014 1:43 PM by jinnocent

# Time Calculation

### Title

Time Calculation

### Post

Hi All,

I'm looking to get the users total hours from 2 breaks in the day.

I'd appreciate any help.

Thanks,

Jean

• ###### 1. Re: Time Calculation

This one, result Time:

Let([
TI = Time_In ;
LT = Leave Time ;
B1 = Break_In1 - Break_Out1 ;
B2 = Break_In2 - Break_Out2
];
LT - TI - B1 - B2
)

Note that each Time Field must contain a time till midnight

• ###### 2. Re: Time Calculation

The difference of any two time fields is the elapsed time in seconds.

( Break_In1 - Break_Out1  + Break_In2 - Break_Out2 ) / 3600

Is the "total hours from 2 breaks"

But I'm not sure that's what you really want.

( Break_Out1 -Time_In  + Break_Out2 - Break_IN + Wrap - Break_In2 ) /3600

would be the total hours worked.

Both examples would specify a number result type. If you specify a Time result type, don't divide by 3600--the number of seconds in an hour.

And if your record might clock times that start before midnight and end after midnight, you should use timestamp values instead of time.

• ###### 3. Re: Time Calculation

Both excellent answers, Thank you both.