- This topic has 0 replies, 1 voice, and was last updated 12 years, 11 months ago by .
Viewing 1 post (of 1 total)
Viewing 1 post (of 1 total)
- You must be logged in to reply to this topic.
Home › Forums › Tech › Web Development › How to compare date portion of SQL dates in C#
You need to compare, if 2 dates are of the same date.
You want to ignore time portion of the dates.
Here is how you do it in C#:
if (_DateDue.Date == DateTime.Today.Date)
In this example, we are comparing a variable _DateDue from database with today’s date.
© 2017 DomainWebCenter.com. All Rights Reserved. | Disclaimer | Contact the Editor