## Overtime calculations are used alongside time calculations within 24 hours.

## This function utilises the normal "Start Time" and "Finish Time" calculations, but then also displays in separate fields where values reach a designated amount.

## E.g. Normal hours are set at the maximum value of 8, and everything above this amount is then calculated as either time and a half or double time using calculations.

Object names of target fields:

- Start Time = [
**startTime**] - Finish Time = [
**finishTime**] - Total Hours = [
**totalHours**] - Normal Hours = [
**normalHours**]

Other things to always remember:

- The "Advanced Calculation" setting must be selected in the calculation field settings.
- All Time / Date fields used in the calculation must be set to "Required" in the field settings

Use the below code in the 4 separate calculation fields

Total Hours Calculation - [**totalHours**]

var timediff = myNS.helper.time_diff( "01/01/1999 [**startTime**]", ([**startTime**] > [**finishTime**] ? "01/02/1999 [**finishTime**]" : "01/01/1999 [**finishTime**]") ); value = (timediff.hours + ((timediff.minutes / 60)));

Normal Hours Calculation - [**normalHours**]

if([**totalHours**] > 8) value = 8; else value = [**totalHours**];

Overtime Calculation

if([**totalHours**] - [**normalHours**] > 2) value = 2; else value = [**totalHours**] - [**normalHours**];

Double Time Calculation

if([**totalHours**] > 10) value = [**totalHours**] - 10;

Once added to the form, this will display as below (using a table layout):