title: calculating average for time in hh:mm format
body: <p>I have an array of time in hh:mm format and am trying to figure out how to properly calculate the average.</p>
  
  <p>I found this <a href="http://jsfiddle.net/3yVMK/1/" rel="nofollow noreferrer">fiddle</a> that does something similar but has miliseconds too which I don't need and I am having hard time converting it to what I need.</p>
  
  <pre><code>var times= [ '00:00:03.00', '00:00:05.00', '00:00:02.00', '00:00:06.00'],
      date = 0,
      result = '';
  function offsetify(t){
      return t &lt; 10 ? '0' + t : t;
  }
  for(var x = 0; x &lt; times.length; x++ ) {
      var tarr = times[x].split(':');
      date += new Date(0, 0, 0, tarr[0], tarr[1], tarr[2].split('.')[0], tarr[2].split('.')[1]).getTime();   
  }
  var avg = new Date(date/times.length);
  result = offsetify(avg.getHours()) + ':' + offsetify(avg.getMinutes()) + ':' + offsetify(avg.getSeconds()) + '.' + offsetify(avg.getMilliseconds());
  document.write(result);
  </code></pre>
  
  <p>can someone please help to modify this so it would provide correct average for array that looks like this:</p>
  
  <pre><code>var times= [ '00:03', '00:13', '02:10', '01:00']
  </code></pre>
  
  <p>thanks!</p>