Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Subtracting hours
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00795391
Message ID:
00795406
Views:
13
>As I can make to subtract hours? I need a code that can subtract hours

If the stop/start times are in datetime format and you need the result in a character format, the following code will do it.

mtime=stop-start
msecs=mtime%60
mtime=int(mtime/60)
mmins=mtime%60
mhrs =int(mtime/60)
hrsworked = str(mhrs,2)+':'+iif(mmins>9,str(mmins,2),'0'+str(mmins,1))+':'+iif(msecs>9,str(msecs,2),'0'+str(msecs,1))
If Bill Gates had a penny for every time windows crashed he'd be... Oh wait he does!
Previous
Reply
Map
View

Click here to load this message in the networking platform