Converting/formatting date object
<p>I am working on a jquery calendar script. 
In the script, selecting a row gives a date object as callback.</p>

<pre><code>select: function(start, end, allDay) {
                       $("#datepicker_add").val(start);
                       $("#datepicker_add_end").val(end);
                    calendar.fullCalendar('renderEvent',
                        {
                            title: title,
                            start: start,
                            end: end,
                            allDay: allDay
                        },
                        true // make the event "stick"
                    );

                calendar.fullCalendar('unselect');
            },
</code></pre>

<p>Here that <code>start</code> and <code>end</code> objects are like that <code>Wed Aug 22 2012 00:00:00 GMT+0300 (EEST)</code>
What i want is to format this as <code>Y-m-d</code> </p>

<p>How can i do that ?</p>
