Link to home
Start Free TrialLog in
Avatar of jentel2
jentel2

asked on

How to compare date without time portion?

I am comparing a date entered in a textbox with DateTime.Now. If date by user is today, the comparison

if (txtDate.text > DateTime.Now) is true. My guess is that the time portion of txt entered is today midnight.

What's the best to do date comparison without using the time portion?
Avatar of p_davis
p_davis

DateTime.Now.Date
ASKER CERTIFIED SOLUTION
Avatar of p_davis
p_davis

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial