Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Difference between two hours
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01011564
Message ID:
01011605
Views:
10
This message has been marked as the solution to the initial question of the thread.
Try
FUNCTION TimeDiff_ut
LPARAMETERS tcStartTime, tcEndTime
LOCAL lnSec
lnSec = CTOT(tcEndTime) - CTOT(tcStartTime)
RETURN SUBSTR(TTOC(CTOT("00:00") + lnSec,3),12,5)
>
>a big big thank....
>There is still a little problem
>please try this code
>
>
>FUNCTION test91()
>
>WAIT WINDOW  TimeDiff_ut( "21:00" , "23:30")
>*-- return "02:29"
>ENDFUNC
>*-- 05/2005 UT Thread no 1011564
>FUNCTION TimeDiff_ut
>  LPARAMETERS tcStartTime, tcEndTime
>
>  LOCAL lnSec,;
>  cValue
>
>  lnSec = CTOT(tcEndTime) - CTOT(tcStartTime)
>  cValue = PADL(INT(lnSec/3600), 2, "0") + ":" + ;
>    PADL(INT((lnSec%3600)/60),2, "0") && + ":"
>
>  RETURN cValue
>
>ENDFUNC
>
>
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform