title: PHP strtotime: Get previous month
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/5489502/how-to-get-previous-month-and-year-relative-to-today-using-strtotime-and-date">How to get previous month and year relative to today, using strtotime and date?</a>  </p>
  </blockquote>
  
  
  
  <p>Today is December, 31st but <code>strtotime("-1 months")</code> returns December:</p>
  
  <pre><code>echo date("Y-m", strtotime("-1 months"));
  </code></pre>
  
  <p>Same for <code>strtotime("last month")</code></p>
  
  <p>How can I properly return the previous month (November)?</p>
  
  <p>Test: <a href="http://codepad.viper-7.com/XvMaMB" rel="noreferrer">http://codepad.viper-7.com/XvMaMB</a></p>