title: How to get selected day/month and year from jquery datepicker
body: <p>I am using the Jquery UI Datepicker plugin, I am trying to get the selected day, month and year from the datepicker in different variables (final solution is to assign all 3 variables to hidden fields).</p>
  
  <p>Here is the code:</p>
  
  <pre><code>        $(function() {
          $("#_StartDate").datepicker(
              {
                   onSelect: function(dateText, inst) {
                      var startDate = new Date(dateText);
                      var selDay = startDate.getDay();
                      alert(selDay);
                   }
              }
          );
      });
  </code></pre>
  
  <p>I selected the date "1/10/2011" and it returns "1". I selected the date "1/25/2011" and it returns "2". What am I doing wrong here?</p>
  
  <p>Thanks for your help!</p>