posted 22 years ago
Hi,
I have been looking for code examples of how to take 2 dates, compare them to see if the difference is > or < than a desired value, then perform an action.
Here is the code I am using so far:
In my main app, I am executing the following:
The problem is, for comparing the time between 01.01.2002 and 06.30.2002, the result is 179 instead of 181. For 07.01.2002 to 12.31.2002, the result is 183 instead of 184. Where am I losing the accuracy here? I tried converting them to floats in order to make sure that rounding wasn't affecting this, but no luck.
Can someone tell me the best practice for doing this? I would think this is a fairly common action that must be performed in programs.
Thanks in advance!
bp