Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to calculate elapsed time
Message
 
 
To
05/05/2006 11:27:29
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:
01119633
Views:
21
>OK here is my input:
>
>86401
>
>Cetin

Right, this function only works for lnSeconds < 3600 * 24 I can add some code to handle it, but basically the elapsed time is never going to be that big.
function SecondsToTime
lparameters tnSeconds
local lcElapsedTime
if m.tnSeconds > 86400 && More than one day
	lcElapsedTime = padl(int(m.tnSeconds/86400),2,'0') + ":" + substr(ttoc({^2006/01/01 00:00:00} + m.tnSeconds,3),12)
else
	lcElapsedTime = substr(ttoc({^2006/01/01 00:00:00} + m.tnSeconds,3),12)
endif
return m.lcElapsedTime
endfunc
Now, of course this would not work if the elapsed time is months or years <g>
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform