Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
TimeStamps calculating differently
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
TimeStamps calculating differently
Miscellaneous
Thread ID:
01248245
Message ID:
01248245
Views:
75
Hi all

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 :) ?
Regards
Bhavbhuti
___________________________________________
Softwares for Indian Businesses at:
http://venussoftop.tripod.com
___________________________________________
venussoftop@gmail.com
___________________________________________
Next
Reply
Map
View

Click here to load this message in the networking platform