I am very new to Livecycle and need some assistance with a form that I am trying to create. I have done a lot of Internet searches but nohing so far.
I have a form that I want to calculate elapsed time and then convert to a time format: hour, minute and time.
Here is what I have:
topmostSubform.Page1.ElapsedTime::calculate - (FormCalc, client)
var elapsed = (Time2Num(EndTime.formattedValue, "HH:MM:SS") - Time2Num(StartTime.formattedValue, "HH:MM:SS")) / (1000 * 60)
if (elapsed < 0) then
elapsed = 1440 + elapsed
else
elapsed
endif
// hours
var Hrs = Ltrim(Str(Floor(elapsed / 60)))
// min
var Mins = Right(Concat("0", Ltrim(Str(Mod(elapsed, 60)))), 2)
// sec
var Secs = Right(Concat("0", Ltrim(Str(Mod((elapsed*60),60)))), 2)
//display on form
Concat (Hrs, ":", Mins, ":", Secs)
Problem with this is that if seconds are equal to or less than 30, then the calculation is off by a minute.
For example, if starttime is 12:10:20 and endtime is 13:00:00, instead of getting elapsedtime = 00:49:40 I get 00:50:40.
Thanks in advance and any help will be greatly appreciated!!!
you can use FormCalc for this purpose.
radzmar
• LoveCycle Blog
Documents you need:
• LiveCycle Designer ES2 Docs