title: Subtract one month from Datetime.Today
body: <p>I have a <code>DateTimePicker</code> in which I allow user to select month previous to the current year. </p>
  
  <p>The problem is, that if the date is 1st January, it can't calculate the December month of last year in the way I am doing it now.</p>
  
  <pre><code>var today = DateTime.Today;
  
  var lastmonth = new DateTime(today.Year, today.Month - 1, 1);
  if (qs == "")
  {
      dateTimePicker1.MaxDate = lastmonth;
      dateTimePicker1.Value = lastmonth;
  }
  else
  {
      DateTime dt = Convert.ToDateTime(qs);
  
      dateTimePicker1.Value = dt;
      dateTimePicker1.MaxDate = lastmonth;
  }
  </code></pre>