title: Time conversion to ISO string is not correct with text field displayed
body: <p>I have a text field in an MVC application that displays the date and time.  The date is created using a datepicker and the time I add to the text field.
  An example of the text is as follows:   </p>
  
  <pre><code>10/23/2015 12:00 AM
  </code></pre>
  
  <p>I want to create a Date object with this time in ISO 8601 format.  The date will be used to create an event in a fullcalendar jquery plugin.
  When I try to create the Date object, the ISO string is:</p>
  
  <pre><code>2015-10-23T04:00:00.000Z
  </code></pre>
  
  <p>It should be <code>2015-10-23T00:00:00.000Z</code> to represent midnight on that day.
  This is my code:</p>
  
  <pre><code>&lt;label id="schedule_start_date_lbl"&gt;Start Date: &lt;/label&gt;
  &lt;input id="schedule_start_date" type="text" /&gt;
  
  var startDayIndex = getDayIndex($('#rotation_start_time_txt').val());
  $("#schedule_start_date").datepicker({
      minDate: 0,
      beforeShowDay: function (date) { return [date.getDay() == startDayIndex, ""] },
      onSelect: function (dateText) {
          $('#schedule_end_date').datepicker('option', 'minDate', dateText);
      },
      onClose: function (selectedDate) {           
          var rotation_txt = $('#rotation_start_time_txt').val();
          var time = rotation_txt.substr(rotation_txt.indexOf(',') + 1);
          $(this).val(selectedDate + time.toString(' HH:mm tt').toString());
      }
  });
  
      $("#rotation_schedule_btn").click(function () {
  //text value in schedule_start_date is: 10/23/2015 12:00 AM
   var startDate = new Date($('#schedule_start_date').val()).toISOString();
   //Value displayed is 2015-10-23T04:00:00.000Z
   alert('startDate: ' + startDate);
  });
  </code></pre>
  
  <p>Why is the time value off by 4 hours?
  Thanks</p>
  
  <p><strong>UPDATE</strong>
  I need to add to the Date objects after they are created.  Creating the Date object using the function in the answer below is not creating it in UTC format.  It can be <strong>displayed</strong> in that format but when I am creating events in the fullcalendar control, the date <em>must</em> be in UTC format and they are not.
  This is my function to create a schedule:</p>
  
  <pre><code> $("#rotation_schedule_btn").click(function () {
      //create member list order    
      var memberList = [];         
      $("#rotationList li").each(function () {
          memberList.push({
              id: $(this).attr('id'),
              name: $(this).text(),
              color: $(this).css('background-color')
          })
      });
  
      //start and end date and time for new schedule
      var startDate = convertTextToDate($('#schedule_start_date').val())
      var endDate = convertTextToDate($('#schedule_end_date').val());
  
      //remove events between startDate &amp; endDate
      $('#edit_calendar').fullCalendar('removeEvents', function (event) {
          if (event.start.toDate() &gt;= startDate &amp;&amp; event.start.toDate() &lt;= endDate
                 || event.end.toDate() &gt;= startDate &amp;&amp; event.end.toDate() &lt;= endDate) {
              return true;
          }
      });
  
      //Create events from rotation schedule selected
      var newEvents = [];
      var rotation_length = $('#rotation_type_select option:selected').val();
      var rotation_start_date = new Date(startDate.toISOString());
      var rotation_end_date = new Date(startDate.toISOString());
  
      //End date is to midnight
      endDate.setMinutes(endDate.getMinutes() + 1);
      rotation_end_date.setDate(rotation_end_date.getDate() + parseInt(rotation_length));
  
      var member_index = 0;
      while (rotation_end_date &lt;= endDate)
      {
     //     alert('start date: ' + rotation_start_date.toISOString() + ' end date: ' + rotation_end_date.toISOString());
          var event = new Object();
          event = {
              title: memberList[member_index].name,
              start: new Date (rotation_start_date.toISOString()),
              end: new Date (rotation_end_date.toISOString()),
              objectID: memberList[member_index].id,
              color: memberList[member_index].color,
              allDay: true,
              textColor: 'white'
          };
          newEvents.push(event);
          eventsAdded.push(event);
  
          rotation_start_date.setDate(rotation_start_date.getDate() + parseInt(rotation_length));
          rotation_end_date.setDate(rotation_end_date.getDate() + parseInt(rotation_length));
  
          if ((memberList.length - 1) == member_index) {
              member_index = 0;
          }
          else {
              member_index++;
          }
      }           
      //Render events on calendar
       $('#edit_calendar').fullCalendar('addEventSource', newEvents);
      }); //end create schedule button click
  </code></pre>
  
  <p>The function to convert the dates is the same as below but I renamed the function:</p>
  
  <pre><code>function convertTextToDate(dateValue)
  {   
      var dateArray = dateValue.split(/\D/);
      var pm = /pm$/i.test(dateValue);
      var hour = (+dateArray[3] || 0) % 12 + (pm ? 12 : 0);
      var date = new Date(Date.UTC(dateArray[2], dateArray[0] - 1, dateArray[1], hour, +dateArray[4] || 0, +dateArray[5] || 0));
      return date;
  }
  </code></pre>
  
  <p>What am i doing wrong?</p>