title: How to set datetime on datetime-local via jQuery
body: <p>I have datetime-local html control on my form and I need to set date and time on it dynamically via JS or jQuery.  How can I do it?</p>
  <pre><code>&lt;input type=&quot;datetime-local&quot; id=&quot;publishDate&quot; required/&gt;
  </code></pre>
  <p>I tried</p>
  <pre><code>$(&quot;#publishDate&quot;).val(&quot;2013-3-18 13:00&quot;);
  $(&quot;#publishDate&quot;).val(&quot;2013-3-18T13:00&quot;);
  $(&quot;#publishDate&quot;).val(new Date().toLocalString());
  </code></pre>
  <p>but nothing worked.</p>