How to format this date + time got from JavaScript? (+jsFiddle)
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/1536516/how-to-display-a-date-as-2-25-2007-format-in-javascript-if-i-have-date-object">how to display a date as 2/25/2007 format in javascript, if i have date object</a>  </p>
</blockquote>



<p>How can I format the following date+time to this one     <strong>2012-07-24 17:00</strong> ?</p>

<p><a href="http://jsfiddle.net/28Tgz/1/" rel="nofollow">http://jsfiddle.net/28Tgz/1/</a></p>

<p>I am trying to make use of </p>

<pre><code>formatDate('yy-mm-dd HH:ii', now)); 
</code></pre>

<p>without luck.</p>

<pre><code>jQuery(document).ready(function() {
var foo = jQuery('#foo');

function updateTime() {
    var now = new Date();
    foo.val(now.toString());        
}

updateTime();
setInterval(updateTime, 5000); // 5 * 1000 miliseconds
});
</code></pre>

<p>this return me 
<strong>Wed Jul 25 2012 17:14:02 GMT+0300 (GTB Daylight Time)</strong></p>
