How to format the output of the javascript function date() ?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/3552461/how-to-format-javascript-date">how to format javascript date</a>  </p>
</blockquote>



<p>I have the following bit of code </p>

<pre><code> $('#ins_date').attr('value', Date());
</code></pre>

<p>What i get is this : Wed Mar 21 2012 17:52:32 GMT+0100 (Romance Standard Time)</p>

<p>How could i format this string to get somethingh like this : 2012-03-01</p>
