As the title states, what's the best way to compare to DateTime's without hours and seconds?
I don't want to convert my dates to string, and a solution like
DateTime.Now.Year == last.Year && DateTime.Now.Month == last.Month && DateTime.Now.Day == last.Day
is pretty damn ugly.
Edit: Oh my god, how silly I feel. Of course you can use the Date property.
"Another question": What is the best way to compare DateTime's with Year, Month, Day, Hour, Minute, but not seconds?
Thanks
Is this: what you're looking for?
DateTime.Now.Date
Take a look at the Date property, then you can compare dt1.Date with dt2.Date.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With