Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to get the time from Second()...
Message
From
04/11/2003 23:53:31
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00846324
Message ID:
00846330
Views:
23
This message has been marked as the solution to the initial question of the thread.
>I am looking for a formula that will give me the time (HH:MM:SS) from the Second() function.
>
>Any one did this already?
* This routine converts a numeric value representing seconds,
* into a character string of hh:mm:ss format.
* Anything over 24 hours is still expressed as hours e.g. 174:22:31
* expN1 Seconds
FUNCTION SecondToFormat
PARAMETERS tnSecond
LOCAL lnHour,lnMinute,lnSecond
lnHour=INT(tnSecond/3600)
lnMinute=INT((tnSecond-(lnHour*3600))/60)
lnSecond=(tnSecond-(lnHour*3600)-(lnMinute*60))
RETURN PADL(LTRIM(STR(lnHour)),2,'0')+':'+PADL(LTRIM(STR(lnMinute)),2,'0')+':'+PADL(LTRIM(STR(lnSecond)),2,'0')
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Reply
Map
View

Click here to load this message in the networking platform