Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to calculate elapsed time
Message
 
 
À
05/05/2006 11:27:29
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01016916
Message ID:
01119633
Vues:
20
>OK here is my input:
>
>86401
>
>Cetin

Right, this function only works for lnSeconds < 3600 * 24 I can add some code to handle it, but basically the elapsed time is never going to be that big.
function SecondsToTime
lparameters tnSeconds
local lcElapsedTime
if m.tnSeconds > 86400 && More than one day
	lcElapsedTime = padl(int(m.tnSeconds/86400),2,'0') + ":" + substr(ttoc({^2006/01/01 00:00:00} + m.tnSeconds,3),12)
else
	lcElapsedTime = substr(ttoc({^2006/01/01 00:00:00} + m.tnSeconds,3),12)
endif
return m.lcElapsedTime
endfunc
Now, of course this would not work if the elapsed time is months or years <g>
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform