Here is a code snippet where in I have to select a proper date to book an appointment, it should do a simple validation that the date selected for the appointment is a date which is either the current date or later than that.
if (dateTimePicker1.Value < DateTime.Now)
toolStripStatusLabel1.Text = "Date Selected is not Proper";
else (dateTimePicker1.Value >= DateTime.Now)
toolStripStatusLabel1.Text = "Date Selected is " + dateTimePicker.Value;
However, here when I select the Current date it always goes in the if block.When ever I select a date later than the current date it works fine.
Thank you
Because DateTime.Now includes the time of the day, try DateTime.Today this only gets the date.