title: Subtract a date by 1 or 2 in groovy
body: <p>I need to get a date by subtracting a number from current date in MM/dd/yyyy format</p>
  
  <p>I got the current date by using <code>new Date().format("MM/dd/yyyy")</code></p>
  
  <p>Please help me with a function that subtracts 1,2 to the above date and produces a date in MM/dd/yyyy format</p>
  
  <p>I have tried</p>
  
  <pre><code>def today = new Date().format("MM/dd/yyyy")
  def yesterday = today -1
  println today
  println yesterday
  </code></pre>
  
  <p>which gives me </p>
  
  <pre><code>01/11/2012
  0/11/2012
  </code></pre>