title: Javascript convert string to date format yyyy-MM-dd
body: <p>I have a string which is in the format "05-01-2016" when i run the below code in chrome i get the correct output</p>
  
  <blockquote>
    <p>var fromDate = new Date(searchOpts.RunDateFrom);</p>
  </blockquote>
  
  <pre><code>        fromDate.format("yyyy-MM-dd");
  </code></pre>
  
  <p>output = "2016/05/01"</p>
  
  <p>However, when this code is execute inside my js file i get this output</p>
  
  <blockquote>
    <p>Sun May 01 2016 00:00:00 GMT+0530 (India Standard Time)</p>
  </blockquote>
  
  <p>How do i prevent this? I need to pass the date in this format "2016-05-01" to solr</p>