Expand my Community achievements bar.

time difference miscalculation

Avatar

Former Community Member
The following Java script is entered in as the "total time" calculation formula



"this.rawValue = endingTime.rawValue - beginningTime.rawValue" however when the following times are inserted the calculation accuracy fails.



beginning time: 1430

ending time: 1700



the total time becomes 2:70 rather than 2:30.



The reason seems to be the time format in PM mode is reading as a numeric formula rather than a time formula. Therefore, the subtraction is standard borrowing and carrying (1700 becomes 1600 + 100 + 0) rather than time (1700 becomes 1600 + 60).



Does anyone have a solution?



I have also tried resolving the issue using "FormCalc" but with no success



Please help!



thanks,



tom
0 Replies