Ideally when you compare dates you should have both the dates in same format otherwise you will end up with weird output. This is a small snippet for date comparison.
public void CompareDates()
{
string inputDate = "05/21/2016";
DateTime convertedDate = DateTime.Parse(inputDate);
DateTime nowDate = DateTime.Now;
if (nowDate >= convertedDate)
{
}
else
{
}
if (nowDate.Date >= convertedDate.Date)
{
}
else
{
}
}
Put a debugger at the very beginning of the code and see what the compiler gives you on each line. For different date formats please refer
this[
^] and
this[
^] links