title: How to compare a given date from today
body: <p>I want to compare a given date to today and here is the condition: If provided date is greater than or equal to 6 months earlier from today, return true else return false</p>
  
  <p>Code:</p>
  
  <pre><code>string strDate = tbDate.Text; //2015-03-29
  if (DateTime.Now.AddMonths(-6) == DateTime.Parse(strDate)) //if given date is equal to exactly 6 months past from today (change == to &gt; if date has to be less 6 months)
  {
      lblResult.Text = "true"; //this doesn't work with the entered date above.
  }
  else //otherwise give me the date which will be 6 months from a given date.
  {
      DateTime dt2 = Convert.ToDateTime(strDate);
      lblResult.Text = "6 Months from given date is: " + dt2.AddMonths(6); //this works fine
  }
  </code></pre>
  
  <ul>
  <li>If 6 months or greater than 6 months is what I would like for one
  condition</li>
  <li>If less than 6 months is another condition.</li>
  </ul>