|
-
Feb 10th, 2006, 07:45 AM
#1
Thread Starter
PowerPoster
DateTime problem
Hi.
This is a bit of an issue I found.
My application has an object which has a property/field of a dateTime value.
On every tick, the current time is compared with the objects' datetime value and if it succeeds, it does a particular operation.
Now, thats fine when comparing TIME but when I want to compare the current Date/Time (DateTime.Now) - the condition never evaluates to true with the objects' datetime property 
I can compare time, by specifiying each of the "time" values (Hour, Minute, Second) but I would like to be more efficient, and well generally better, and use the DateTime.Now to compare all factors, or at least the current date.
I have tried the DateTime.Equals() and the == operator but both seem to evaluate to false when that time approaches.
There is no code to show at all apart from comparing 2 objects:
Code:
if (DateTime.Now == ((SomeClass)this.TheCollection.TheStartTime)) {..}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|