Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to calculate elapsed time
Message
From
25/05/2005 14:16:13
 
 
To
25/05/2005 03:15:59
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01016916
Message ID:
01017605
Views:
16
>Fred,
>Hope you wouldn't mind, a little shortening (and then making it longer for independency to time formats):
>
>ttoc(ctot('0') + nSeconds,2) && also works as a shorter notation - VFP uses base date

Shorter is *usually* better and in this case it is.

>However this depends on time format settings and is only effective if elapsed time is not more than 24 hours. My suggestion is to use a longer independant way:
>
>
lcHoursMins = ltrim(str(int(m.nSeconds/3600))) + ':'+ltrim(str(m.nSeconds%3600/60))
Cetin

Of course if the difference is greater than 24 hours, you would need some sort of custom format. Yours is as good as any.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Reply
Map
View

Click here to load this message in the networking platform