Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to calculate elapsed time
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01016916
Message ID:
01119696
Views:
13
>I haven't yet looked at what the others have posted, but this is what I use:
>
FUNCTION ShowTime(m.tnElapsed)
>LOCAL m.cTime,m.nHours
>m.nHours = SET("HOURS")
>SET HOURS TO 24
>m.cTime = TTOC(DTOT(DATE(2005,01,01))+m.tnElapsed,2)
>SET HOURS TO (m.nHours)
>RETURN m.cTime
>
Here is what I currently have based on Sergey's message Re: How to calculate elapsed time Thread #1016916 Message #1119600
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
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform