2 Replies Latest reply on Jul 25, 2013 9:09 AM by KZ1030

    Difference Between Two Times

    KZ1030

      I am building a work procedure in LiveCycle, and I want to track how long the procedure takes. To do this I have two time fields and then a third time field to find the difference between the two time fields. From looking at other discussion posts, I was able to find some Javascript code that did partially what I wanted, but I can't get the third time field to display in the format that I want. I have tried editing the Patterns of the fields and that didn't work. Could someone offer some advice on how to edit the format or help me with the code?  I couldn't figure out to attach the actual file, but I attached a picture of the PDF file and of the Javascript code that I used.  If you look at the TimeIn (HH:MM)  and TimeOut (HH:MM) fields (in the picture I attached), you'll notice that the TotalTime comes out as HMM, and I want it to come out as HH:MM.

       

      Adobe Time Difference Example.jpg

       

      Javascript Time Difference Code.jpg

      Any help would be greatly appreciated!

      Thanks