title: Presto: Last day of the month prior
body: <p>I have a list of dates.  I would like to return the last date of the month prior like the below example:</p>
  
  <pre><code>date            lastdayofmonthprior
  '2018-04-03'    '2018-03-31'
  </code></pre>
  
  <p>I have tried <code>date_trunc('month', date('2018-04-03'))-1</code>, however, I get this error:</p>
  
  <pre><code>'-' cannot be applied to date, integer
  </code></pre>
  
  <p>I'm guessing I can't do arithmetic to a date in Presto.</p>