title: Jquery new Date - Convert to yyyy-MM-dd and use toLocaleDateString
body: <p>I have a HTML input box set to type=date</p>
  
  <pre><code>&lt;input name="datereceived" type="date" class="FormDateValues" id="datereceived" /&gt;
  </code></pre>
  
  <p>I want to use Jquery to fill this input box on document load to today's date but because I am in Australia, I have to offset using GMT+10</p>
  
  <p>To get the date, I do the following:</p>
  
  <pre><code>var newDate = new Date();
  </code></pre>
  
  <p>and then I tried to set the input box using the following:</p>
  
  <pre><code>$('#datereceived').val(newDate.toLocaleDateString());
  </code></pre>
  
  <p>The browser tells me that for type=date, the format must be set to yyyy-MM-dd and not the Australian time format of dd/MM/yyyy.</p>
  
  <p>I am not sure how to go about enforcing the toLocaleDateString AND converting the date to yyyy-MM-dd.</p>