title: Javascript Convert Date from short format to Long format
body: <p>I am using the following code:</p>
  
  <pre><code>var date="May-02-2012";
  var startDate = date; 
  var tmp = startDate.split('-'); 
  tmp.splice(1, 0, ','); 
  var convertedStartDate = new Date(tmp.join(' ')); 
  var month = convertedStartDate.getMonth() + 1 
  var day = convertedStartDate.getDate(); 
  var year = convertedStartDate.getFullYear(); 
  var shortStartDate = ('0' + day).slice(-2) + "-" + ('0' + month).slice(-2) + "-" + ('0' + year).slice(-2); 
  return(shortStartDate);
  </code></pre>
  
  <p>The code above allows my to convert May-02-2012 to 02-05-12</p>
  
  <p>however, I now need to convert it from 02-05-12 back to May-02-2012</p>
  
  <p>But I can't work it out..</p>