title: How to add time into date instance using JQuery and get hours by Subtracting Two dates
body: <p>I want to add time into date and want to get hours by subtracting EndDate and StartDate..Following is my try.Please help me</p>
  
  <pre><code>var selectedStartDate;
          var selectedEndDate;
          $("#StartDate").change(function () {
              selectedStartDate = $('#StartDate').datepicker({ dateFormat: 'dd/MM/yyyy' }).val();
              alert(selectedStartDate);
          });
          $("#EndDate").change(function () {
              debugger;
              selectedEndDate = $('#EndDate').datepicker({ dateFormat: 'dd/MM/yyyy' }).val();
              alert(selectedEndDate);
              selectedEndDate = selectedEndDate + ' ' + '12:00:00 AM';
              selectedStartDate = selectedStartDate + ' ' + '10:00:00 AM';
              var timeDiff = Math.abs(selectedEndDate- selectedStartDate);
  
              alert(timeDiff);
          });
  </code></pre>