title: Converting Javascript String to Datetime
body: <p>I have a text box that is populated from a datepicker in Javascript.  The date is stored as <code>30-Jan-2013</code>.  I want to convert this to a date so I can use it in other calculations.</p>
  
  <p>I have tried </p>
  
  <pre><code>var date1 = new Date(document.getElementById('textbox').value)
  </code></pre>
  
  <p>but this returns <code>Nan</code></p>
  
  <p>if I drop the <code>new Date</code> part e.g.</p>
  
  <pre><code>var date1 = (document.getElementById('textbox').value
  </code></pre>
  
  <p>I get the date <code>30-Jan-2013</code> I just don't seem to be able to convert this?</p>