Parse date in javascript
<p>I have a date in the  format <code>16-2-2012</code>.</p>

<pre><code>var k = getTomorrow('16-02-2012',1);
var myTime = k.getDate()+'-'+(k.getMonth()+1)+'-'+k.getFullYear();
</code></pre>

<p>Now I want to parse mytime to a date object. I have tried with </p>

<pre><code>SimpleDateFormat parserSDF=new SimpleDateFormat("dd-M-yyyy");
Date dtstr=parserSDF.parse(myTime);
</code></pre>

<p>But its not working. Is there any way around?</p>
