Time Calculations

I have what SHOULD be a simple piece of code to write: TimeDiff:=“End Time”-“Start Time”; I know that TimeDiff is an integer and a decimal intepretation of TIME. So, Do I at this point divide by 100 and then 60 to convert to minutes OR Someone suggested to use: TimeDiff(Mod60) Cant remeber the exact syntax right now!! If I use divide by 100 and then 60 to convert to minutes I get almost the correct figure but I get an extra zero on the end !!! i.e “End Time”:=08:03:00 “Start Time”:=08:00:00 TimeDiff SHOULD be 3. But I get 30 with the above calculation… ANY IDEAS [?][?][?]

search for “Duration” in the forum other: http://www.mibuso.com/forum/viewtopic.php?t=2878&highlight=duration

Dean, a simple solution… divide by 1000. [;)] Navision calculates differences of time base on milliseconds, therefore divide by 1.000 to get seconds, divide by 60.000 to get minutes or by 360.000 to get hours… Saludos Nils

Or if you want the diffence as a variable of type Time: TimeDiff := 000000T + (EndTime-StartTime);In your case the result will be 00:03:00.

quote:

TimeDiff := 000000T + (EndTime-StartTime);

If only I knew it was THAT easy. [Wow!] That makes it soooooooo much easier[Yeah!]