title: Java/Groovy - simple date reformatting
body: <p>I'm new to Java/Groovy development and I have a simple string that I would like to reformat, however I get an 'Unparseable date' error when I attempt to run the following:</p>
  
  <pre><code>import java.text.SimpleDateFormat 
  import java.util.Date
  
  String oldDate
  Date date
  String newDate 
  
  oldDate = '04-DEC-2012'
  date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S").parse(oldDate)
  newDate = new SimpleDateFormat("M-d-yyyy").format(date) 
  
  println newDate
  </code></pre>
  
  <p>I'm sure it's something simple, but the solution eludes me.  Can anyone help?</p>