title: Change date format in jquery
body: <p>I keep looking for steps in the Internet on how I can change a format of a certain date</p>
  
  <pre><code>$j("#activitycalendar").datepicker("setDate", $j.datepicker.parseDate("yy-mm-dd",$_GET.critval)); 
  </code></pre>
  
  <p>All I want to do is to set the date of a datepicker depending on what the <code>$_GET.critval</code> contains. And the <code>$_GET.critval</code> contains a date in this format </p>
  
  <blockquote>
    <p>2011-12-05</p>
  </blockquote>
  
  <p>as the jqueryui documents says  </p>
  
  <blockquote>
    <p>"The new date may be a Date object or a string in the current date
    format (e.g. '01/26/2009')" <a href="http://jqueryui.com/demos/datepicker/#method-setDate" rel="nofollow">jQuery UI - Datepicker Demos and Documentation</a></p>
  </blockquote>
  
  <p>so I wanted to change the format of my <code>$_GET.critval</code> so it can change the date of the datepicker. I tried the <code>$j.datepicker.parseDate</code> but it really doesn't work. the return value of that parsing will be like this</p>
  
  <blockquote>
    <p>Mon Dec 05 2011 00:00:00 GMT+0800 (Taipei Standard Time)</p>
  </blockquote>
  
  <p>Is there any solution so I can format the date and set the date of the datepicker? thanks</p>