Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Converting seconds to HH:MM:SS
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01358171
Message ID:
01358198
Views:
21
Here is a shorter version that seems to work okay.
******************************************
* stohms2
******************************************
PARAMETERS tiSeconds
LOCAL seconds,hrs,leftover,mins,secs,lcHMS
*-----------------------------------------*
* Testing
*-----------------------------------------*
IF PCOUNT()=0
	seconds=960
ELSE
	IF VARTYPE(tiSeconds)=[C]
		seconds=VAL(tiSeconds)
	ELSE
		seconds=tiSeconds
	ENDIF 
ENDIF 

hrs = seconds / 3600
leftover = seconds % 3600
mins = leftover / 60
secs = leftover % 60

lcHMS=PADL(ALLTRIM(STR(hrs)),2,'0')+[:]+PADL(ALLTRIM(STR(Mins)),2,'0')+[:]+PADL(ALLTRIM(STR(secs)),2,'0')

return(lcHMS)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform