Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Subtracting times
Message
From
30/10/2003 06:30:33
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00844412
Message ID:
00844442
Views:
27
>Gregory
>
>This works fine to a certain degree. Here is an example:
>
>If the firsttime = 18:00:00
>
>and the lasttime = 18:03:45
>
>Then I would expect to see 00:03:45
>
>BUT
>
>If the firsttime = 14:00:00
>
>and the lastime = 08:00:00
>
>Then I would expect = 18:00:00 which is the time difference and not -06:00:00
>
>Can I incorporate this into my program?

Yes,
if (TimeDiff < 0 )
    TimeDiff = TimeDiff + 86400 && one day
endif

or
TimeDiff = mod(TimeDiff, 86400)
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform