Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
TimeStamps calculating differently
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01248245
Message ID:
01248262
Views:
21
This message has been marked as a message which has helped to the initial question of the thread.
See PRB: DateTime Subtraction May Not Produce an Exact Integer mskb #258998.

>
>Maybe I am tried, need a vacation, or to take my meds, but in any case I am lost. The following code gives me 2 different calculation results for my DateTime Fields
>
>The field cFromDateTime is data-entered as 15/08/2007 08:45:00 AM and cToDateTime is data-entered as 15/08/2007 09:15:00 AM. This gives me the following results:
>4a 1800
>4b 29 60
>5 59 1
>
>But when field cFromDateTime is data-entered as 15/08/2007 12:00:00 AM and cToDateTime is data-entered as 15/08/2007 12:30:00 AM. This gives me the following correct results:
>4a 1800
>4b 30 0
>5 0 0
>
>
>*** total seconds
>lnTotalSecs = EVALUATE(THIS.cToDateTimeField) - EVALUATE(THIS.cFromDateTimeField)
>
>*** div. by one minute
>WAIT WINDOW "4a" + STR(lntotalsecs)
>lnMins      = INT(lnTotalSecs / (1 * 60))
>lnTotalSecs = lnTotalSecs - (lnMins * 60)
>WAIT WINDOW "4b" + STR(lnmins) + STR(lntotalsecs)
>
>*** div. by one second
>lnSecs      = INT(lnTotalSecs / (1))
>lnTotalSecs = lnTotalSecs - (lnSecs)
>WAIT WINDOW "5" + STR(lnsecs) + STR(lntotalsecs)
>
>
>What should it be rest, vacation or meds :) ?
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform