Convert mm-dd-yyyy to date in javascript
<p>I have data in mm-dd-yyyy format. I need it to compare with current date in javascript.</p>

<p>I have got something for data, but it is not working.</p>

<p>My date is 12-07-2016 in mm-dd-yyyy format.</p>

<pre><code>var d = '12-07-2016';
var date= d.split("-");
var f = new Date(date[2], date[1] - 1, date[0]);
</code></pre>

<p>Here I am getting date as :</p>

<blockquote>
  <p>Tue Jul 12 2016 00:00:00 GMT+0530 (India Standard Time)</p>
</blockquote>

<p>But I need it as :</p>

<blockquote>
  <p>07 Dec 2016.</p>
</blockquote>

<p>Thanks in advance.</p>