title: How to change datepicker date format to DD/MM/YYYY
body: <p>Currently, I have an <code>onchange</code> on a <code>datepicker</code> and it calls the following function</p>
  
  <pre><code> $('#dtpFrDate').change(function() {
  
      var date2 = $('#dtpFrDate').datepicker('getDate'); 
      date2.setDate(date2.getDate() -1); 
  
      document.getElementById('dtpToDate').innerHTML = date2.toLocaleDateString();
  });
  </code></pre>
  
  <p>But during <code>onchange</code> my date format is <a href="https://i.stack.imgur.com/CklcE.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CklcE.jpg" alt="d/MM/YYYY"></a> </p>
  
  <p>how to get DD/MM/YYYY? Please help.</p>