title: SQLITE Date difference / Date substraction
body: <p>I got confused</p>
  
  <pre><code>select date('2016-12-31'), date('2016-12-31','-1 month'), date('2016-12-31','-2 month');
  </code></pre>
  
  <p>The result is</p>
  
  <pre><code>2016-12-31  2016-12-01  2016-10-31
  </code></pre>
  
  <p>Is there something I missed?
  I'm expecting </p>
  
  <pre><code>2016-12-31  2016-11-31  2016-10-31
  </code></pre>
  
  <p>I need to get last date on each month.</p>