Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Compute Hours, Minutes, Seconds from SECONDS()
Message
From
07/09/1999 13:04:12
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00261364
Message ID:
00262018
Views:
24
>>>>>>Anybody have a technique for measuring the amount of time it takes a function to process?
>>>>>>
>>>>>>I tried the following ... but that give me total seconds and I need the that result converted to hours:minutes:seconds.
>>>>>>
>>>>>>Other Suggestions? Ideas?
>>>>>>
>>>>>>nStart = Seconds()
>>>>>>.
>>>>>>(my code)
>>>>>>.
>>>>>>
>>>>>>nStop = Seconds()
>>>>>>
>>>>>>nRunTime = nStop-nStart
>>>>>>
>>>>>>How to get nRunTime to look like HH:MM:SS??
>>>>>>
>>>>>>Help?
>>>>>>
>>>>>>Please and thanks.
>>>>>
>>>>>
>>>>>? TTOC(DTOT(DATE())+nRunTime,2)
>>>>
>>>>Interesting- but only good for values > 1 hour and less than 24...
>>>
>>>What do you mean "> 1 hour"? It works with seconds. And you're correct it is only good for up 23:59:59. :) If you want to show days, that's another animal, but it can be done:
>>>
>>
>>Only that for values of less than 3600, it displays 12:00, instead of 00:00...
>
>OIC what the problem is now. If you SET HOURS TO 24, then the hour shows as 00:00:00. I'm sorry, I just find that an AM/PM time to be pretty useless, since I usually deal with operations that are 24/7 (or pretty close to that) and use military time. Sorry for the confusion, and thanks for reminding me of the 12/24 setting.

I agree, military is more useful, but the average business user wants to see AM/PM, so my applications display this way.
Erik Moore
Clientelligence
Previous
Reply
Map
View

Click here to load this message in the networking platform