Date format - Logic error
<p>I have a date saved to the <code>var mydate</code>. When i print that i get the string equivalent of <code>Tue Feb 10 2009 00:00:00 GMT-0800 (Pacific Standard Time)</code>.</p>

<p>Now i need to format the <code>var mydate</code> so it will display the date as <code>Tue Feb 10 2009</code>.</p>

<p>The code;</p>

<pre><code>var today = $(this).datepicker('getDate');
                var mydate = new Date(today.getFullYear(), today.getMonth(), today.getDate() - today.getDay());
</code></pre>

<p>When i display <code>my date</code>, i got the string equivalent of <code>Tue Feb 10 2009 00:00:00 GMT-0800 (Pacific Standard Time)</code>. But what i want is this <code>Tue Feb 10 2009</code>. How can i do this by formatting <code>var my date</code> ?</p>
