Hi Everybody,
Is there a function to convert seconds to a time format like HH:MM:SS ?
Exanple:
nSeconds = 3600
something like SecondsToTime( nSeconds ) would return "01:00:00"
Thanks,
Jeff
FUNCTION MAIN()
LOCAL nSec := SECONDS()
? nSec, SECONDSTOTIME( nSec )
INKEY( 0 )
RETURN NIL
STATIC FUNCTION SECONDSTOTIME( nSec )
LOCAL nHour, nMin
nHour = INT( nSec / 3600 )
nSec -= nHour * 3600
nMin = INT( nSec / 60 )
nSec -= nMin * 60
RETURN STRZERO( nHour, 2 ) + ":" + STRZERO( nMin, 2 ) + ":" + STRZERO( nSec, 2 )
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 76 guests