I can't calculate the difference between two times fields.
For example: I have 3 dateTime fiels but in the Date Format I need only the time (hour)
How can I calculate the difference between 2 times?
time 1: 15:45:00
The result is: ....00:45:00
Thanks a Lot
I have tried to get this code to work but without any luck - I am not sure what I am doing wrong - I have ensured the two fields are called tstart and tend and am using formcalc and calculate - I tried adjusting the code slightly but still without any luck.
Please can you help?
I am trying achieve how much time between a start time and end time (ideally a code that works overnight) - I am using Livecycle ES2
var tStart = Time2Num(tstart.formattedValue, "HH:MM:SS")
var tEnd = Time2Num(tend.formattedValue, "HH:MM:SS")
if (tStart ne 0 and tEnd ne 0) then
//if start time is lower than end time.
if (tStart < tEnd) then
Num2Time(Abs(tStart - tEnd) - 7200000 + 1000, "HH:MM:SS")
//If start time is higher than end time
Num2Time(Abs(86400000 - Abs(tStart - tEnd) - 7200000 + 1000), "HH:MM:SS")