Good Morning,
I use the following formula to calculate elapsed time. IE: 0800 to 0845 = 45 minutes.
var elapsed = (Time2Num(end_pump.formattedValue, "HH:MM:SS") - Time2Num(start_pump.formattedValue, "HH:MM:SS")) / (1000 * 60)
var Hrs = Ltrim(Str(Floor(elapsed / 60)))
var Mins = Right(Concat("0", Ltrim(Str(Mod(elapsed, 60)))), 2)
Concat (Hrs, ":", Mins)
My problem is, I need to use that elapsed time elsewhere as part of a calculation and I cannot figure out how to utilize it. My specific need is this. I am trying to calculate the flow rate on a pump. I take the number of gallons pumped out and divide it by the number of minutes. Of course, left as is, and I get a divide by zero error. I have tried to use Time2Num on the results, but I am not sure what format the output is or if its even still considered a time after the above procedure, so the result is always a zero.
Specs: I am using Live Cycle 8 and we use Military Time.
Any thoughts or suggestions will be greatly appreciated. Thanks for the help!
Mike
George Kaiser