Hi,
Im not sure if you still need assistance, but the following worked for me. I found it in an earlier thred and tweaked it a bit. Im also not very familiar with code but I hope it works for you.
var TimeCount
var OneMinute = 1/60
var StartTime=Time2Num(Row3.Start1.formattedValue,"HH:MM")
var EndTime=Time2Num(Row4.End1.formattedValue,"HH:MM")
if (StartTime ne null and EndTime ne null) then
//if start time is lower than end time.
if (Time2Num(Row3.Start1.formattedValue, "HH:MM") < Time2Num(Row4.End1.formattedValue, "HH:MM")) then
TimeCount = Abs(Time2Num(Row3.Start1.formattedValue, "HH:MM") - Time2Num(Row4.End1.formattedValue, "HH:MM")) /(60 * 60 * 1000)
//If start time is higher than end time
else
TimeCount = 24 - Abs(Time2Num(Row4.End1.formattedValue, "HH:MM") - Time2Num(Row3.Start1.formattedValue, "HH:MM")) /(60 * 60 * 1000)
endif
var Minutes = Round(TimeCount / OneMinute)
var Hours = 0
for i = 0 upto 48 step 1 do
if (Minutes >= 60) then
Minutes = Minutes - 60
Hours = i + 1
endif
endfor
$ = Concat(Hours,":",format("99",Minutes))
endif