Information générale
Catégorie:
Codage, syntaxe et commandes
>>>Does any one know of a function tha converts seconds to hh:mm:ss format. For example: 110 seconds would be 00:01:50.
>>>
>>>TIA,
>>
>>Hi Bill, this should be pretty fast. It's simple and uses no slow maths functions, like ^ and LOG
>>
>>*!***********************************************
>>*!
>>*! Function: S2HMS
>>*!
>>*!***********************************************
>>FUNCTION S2HMS
>>* convert seconds to HHH..:MM:SS
>>LPARAMETER tnSec
>>* hours wont display unless > 0
>>LOCAL nHr, cHr, cMin, nSec
>>
>>* hours
>>nHr= INT(m.tnSec/3600)
>>IF m.nHr = 0
>> cHr= ""
>>ELSE
>> cHr= LTRIM(STR(m.nHr)) + ":"
>>ENDIF
>>
>>* minutes
>>nSec= m.tnSec % 3600
>>cMin= TRANSFORM(INT(m.nSec/60), "@L 99")
>>
>>* the rest
>>RETURN m.cHr + m.cMin + ":" + TRANSFORM(m.nSec % 60, "@L 99")
>
>Thanks Dave,
> Try this one from focus.fll (available for download in the Files section)
>
>? LEFT( TIM_FormatMilli( * 1000 ),8 )
>
>I tested this on an 85 page 4 column report and the screen refreshes going from page to page is VERY fast.
Thanks Bill, I'd download this remarkable fll yesterday. If it does what you want, and you don't mind a 160K .fll (which are not re-entrant - you can't use em twice on the same PC) then it's surely the way to go :-)
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement