Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Converting seconds to hh:mm:ss
Message
De
30/06/1998 22:43:52
 
 
À
30/06/1998 17:24:54
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00113159
Message ID:
00113237
Vues:
32
>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,

As long as it's a one day period, the following should work:
LPARAMETER nElapsedSecs
LOCAL dRefPoint, cReturnString
dRefPoint = DTOT(DATE() ) + nElapsedSecs
cReturnString = PADL(ALLTRIM(STR(HOUR(dRefPoint),2)),2,'0') + ':' + ;
                          PADL(ALLTRIM(STR(MINUTE(dRefPoint),2)),2,'0') + ':' + ;
                          PADL(ALLTRIM(STR(SEC(dRefPoint),2)),2,'0')
RETURN cReturnString
You can get the number of days with TTOD(dRefPoint) - DATE(). You can speed it up slightly by using a date constant in place of DATE().
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform