Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Datetime operations
Message
From
29/10/1997 12:00:24
 
 
To
29/10/1997 11:48:30
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00057210
Message ID:
00057211
Views:
24
>Is there a way to subtract one datetime field from another to find the amount of time between them? I asked this question a few weeks ago but my proble then was solvable using seconds(). This time it isn't.

I guess you should use functions:
Procedure gettime
Parameters dt1,dt2
return 3600*24*(ttod(dt1)-ttod(dt2)+3600*(hour(dt1)-hour(dt2))+ ;
60*(minute(dt1)-minute(dt2))+sec(dt1)-sec(dt2)
You can also format returning value back to days:hours:min:sec
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform