Simple Time Duration Calculation

shawnFMU

11-10-2018

I need a simple Time Duration Calculation. What I've read and piece together, I can't seem to get it to work.

Time2Num and Num2Time...

Help!

In 1 day, Start time and End time equal how much Total time. Example 1:00 to 3:00 equal 2

I've set three Text Fields.

Time1

Time2

Total

Total text field, Calculate event, JavaScript

var start = Time2Num(Time1.formattedValue, "HH:MM")

var end = Time2Num(Time2.formattedValue, "HH:MM")

var dur = Num2Time(end + start, "HH:MM")

this.rawValue = dur;

Thank you in advance!

View Entire Topic

mouslander

12-10-2018

Here is a script I used. It was odd that it wasn't working and I realized my form was set as "Static" once I saved it as "Dynamic" it worked.

FormCalc

var a = (Time2Num(Time1.formattedValue)/ (60 * 60 * 1000))

var b = (Time2Num(Time2.formattedValue)/ (60 * 60 * 1000))

$ = b-a