title: Comparing two time variables with jquery
body: <p>This is my jQuery code. In this code <code>#StartTime</code> and <code>#EndTime</code> is form input tag id's. </p>
  
  <p>The getting time format is 00:00 AM/PM. </p>
  
  <p>The var starttimeval and endtimeval contain values of getting start and end time.</p>
  
  <p>How do I compare these two times, example: <code>if(starttimeval &lt; endtimeval){alert(message);}</code></p>
  
  <pre><code>  $(function() {
      $('#StartTime').datetimepicker({
          datepicker : false,
          format : 'g:i A'
      });
      $('#EndTime').datetimepicker({
          datepicker : false,
          format : 'g:i A'
  
      });
       var starttimeval=  $("#StartTime").val();
       var endtimeval= $("#EndTime").val();
  
        });
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/H125b.jpg" alt="this is my form image.its show the time selection using datetimepicker plugin."></p>
  
  <p>i want only time compare functionality. example getting value of starttimeval=8:00 PM and endtimeval=9:00 AM</p>