title: How can I calculate the difference between two times
body: <p>In JavaScript, how can I calculate the difference between two times.</p>
  
  <p>Example: Get how many hours:minutes elapsed from 01:30 to 3:30</p>
  
  <p>Below I'm getting time values from dropdown menus and trying to calculate the difference in between the two times. </p>
  
  <pre><code>    &lt;select name="timestart"&gt;
      &lt;option value="00:00"&gt;00:00 am&lt;/option&gt;
      &lt;option value="00:30"&gt;00:30 am&lt;/option&gt;
      &lt;option value="01:00"&gt;01:00 am&lt;/option&gt;
      &lt;/select&gt;
  
  Result must be like this: - 00:30-01:00 = 00:30
  </code></pre>
  
  <p>so please suggest solution.</p>