Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Datetime variation in HH:MM:SS
Message
From
07/09/2002 16:48:20
 
 
To
07/09/2002 14:36:56
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00697929
Message ID:
00697945
Views:
18
This message has been marked as a message which has helped to the initial question of the thread.
I've probably written this function 10x since the FoxBASE+ days, I keep losing them... the last one I wrote two days ago:
* 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
LPARAMETERS ;
	tnSeconds

LOCAL ;
	lnHours, ;
	lnMinutes, ;
	lnSeconds

lnHours = INT(tnSeconds / 3600)
lnMinutes = INT((tnSeconds - (lnHours * 3600)) / 60)
lnSeconds = (tnSeconds - (lnHours * 3600) - (lnMinutes * 60))

RETURN ;
	LTRIM(STR(lnHours)) + [:] ;
		+ PADL(LTRIM(STR(lnMinutes)), 2, [0]) + [:] ;
		+ PADL(LTRIM(STR(lnSeconds)), 2, [0])
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform