title: How to convert a Javascript Date into sql datetime with the following format yyyy-mm-dd hh-mi-ss?
body: <p>i need to send a datetime from javascript to sql in this folowing format:  yyyy-mm-dd hh-mi-ss.
  After creating a variable </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var n = new Date()</code></pre>
  </div>
  </div>
  </p>
  
  <p>what should i do to fetch number in that format ?
  Thank you in advance !!</p>