Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to calulate duration of time
Message
From
25/05/1999 13:59:37
 
 
To
25/05/1999 13:47:17
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00222554
Message ID:
00222594
Views:
21
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform