Quantcast
Channel: Adobe Community : Popular Discussions - LiveCycle Designer
Viewing all articles
Browse latest Browse all 16286

time over 24hr not calculating

$
0
0

if (HasValue(startsamplingtime) and HasValue(endsamplingtime)) then

 

   var millisecondsPerMinute = 1000 * 60;

 

   var millisecondsPerHour = millisecondsPerMinute * 60;

 

   var interval = Time2Num(endsamplingtime.formattedValue, "HH:MM:SS") - Time2Num(startsamplingtime.formattedValue, "HH:MM:SS");

  

    // Calculate the hours, minutes, and seconds.

 

   var hours = Floor(interval / millisecondsPerHour );

 

   interval = interval - (hours * millisecondsPerHour );

 

   var minutes = Floor(interval / millisecondsPerMinute );

 

   interval = interval - (minutes * millisecondsPerMinute );

 

   var seconds = Floor(interval / 1000 );

        

   Concat( Format("Z9", hours), ":", Format("99",minutes), ":", Format("99", seconds))

 

endif

 

Need to incorporate date to make this calculation work right for over 24hrs. Don't want to have a date/time field if possible.  Would like to keep the fields separate.  For example:

 

Start Date 01/02/2014       Start Time 12:23:52  

End Date 01/03/2014        End Time   01:23:52

Total Time 1:00:00

 

Thanks


Viewing all articles
Browse latest Browse all 16286

Trending Articles