title: How to change Groovy Date format
body: <p>I want to get my dates into a format like this:  <code>2010-10-01</code></p>
  
  <p>How do I do this?</p>
  
  <p>Also, I grabbed this from another question:</p>
  
  <p><code>use (groovy.time.TimeCategory) {</code></p>
  
  <pre><code>Date date = Date.parse("dd-MMM-yyyy", "15-Mar-2011")
  
  def months = (0..11).collect { 
      (date + it.months).format("MMM/yyyy") 
  }
  </code></pre>
  
  <p><code>}</code></p>
  
  <p>How would I change the output of this script to the format I specified above?  Thanks:)</p>