Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to calulate duration of time
Message
De
25/05/1999 13:59:37
 
 
À
25/05/1999 13:47:17
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00222554
Message ID:
00222594
Vues:
23
>Hi,
> when i try this
>>>nTimeInHours = (DATETIME()-tStartTime)/3600
>the error message : Operator/Operand type mismatch
>

Then you didn't set tStartTime to a DATETIME() or smething equivalent. The following code works:
tMyStartTime = DATETIME() &&store the DATETIME() result
? TYPE('tMyStartTime')  && should be T - a time variable
tEndTime = tMyStartTime + 100000  && equivalent to waiting 100,000 seconds
? TYPE('tEndTime')  && also T - another time variable
nResultInSecs = tEndTime - tMyStartTime  && I'll bet it's 100,000!
? TYPE('nResultInSecs')  && it's an N - numeric
? nResultInSecs/3600  && should be 27.7778
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