Home Forums Tech Web Development How to compare date portion of SQL dates in C#

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #2318
    Mr. Mangus
    Participant

    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.

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.