VFP supports arithmetic on datetime values. When you substract one datetime from another you get the elapsed time in SECONDS.

ie:

datetime(2008,1,1,15,0,0) – datetime(2008,1,1,14,0,0) is 3600 SECONDS.

However be carefull with datetime arithmetic and round the value to 0:

Code Snippet

lnSeconds = round(m.ltEnd – m.ltStart, 0)

And here is a little trick for formatting the result as time (in 24hr range):

Code Snippet

? TRANSFORM(RIGHT(TTOC(CTOT(‘0′)+(m.ltEnd – m.ltStart),1),6),’@R 99:99:99’)