C (223/304)

From:Ilkka Lehtoranta
Date:24 Aug 2000 at 21:02:32
Subject:Re: Comparing Dates

--- Colin Wenzel <colstv@hotkey.net.au> wrote:

> I think it may be a math conversion / rounding problem.....

This is my opintion too...

> I had a problem similar to this, I didn't spend a lot of time on it
> but I believe I found that only EVEN ticks work with CompareDate(),
> I don't know why, or even if that was actually the problem,
> but I just ANDED the ds_Ticks of both datestamps with 0xFFFFFFFC
>
> stamp.ds_Tick &= 0xFFFFFFFC;
>
> That round it down to the nearest 4 ticks.
>
>
> Or, you could just set the ds_Ticks field to 2 in both datestamps
> before comparing with CompareDates().
>
> The worst that can happen with this, is that it won't see a
> date change of less than 1 minute difference.

Normally ds_Ticks field should be even multiples of 50 ticks (so
50 ticks is always one second). But if the struct DateStamp doesn't
follow this rule you have got a problem.

For example, 50 ticks doesn't equal to 55 ticks in DateStamps, but
when converted to struct ClockData you should get two identical dates.
(Only "full" seconds are counted.) I haven't really verified this
myself, this is just what I think, but this looks like a rounding
problem anyway...

__________________________________________________
Do You Yahoo!?
Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/