title: Adding HH:MM:SS strings in Javascript
body: <p>I don't think I can figure this out on my own. 
  Lets say I have a time in the string format of HH:MM:SS ex. <code>10:11:06</code> and I would like to add another time to it and return it as a string. ex. <code>"10:11:06" + "11:00:01" would return "21:11:07"</code> </p>
  
  <p>I have gone through this site coming up with a solution of converting it to seconds and then adding them together as such: </p>
  
  <pre><code>function addTimes(start, end) {
   var a = start.split(":");
   var seconds = (+a[0]) * 60 * 60 + (+a[1]) * 60 + (+a[2]); 
   var b = end.split(":");
   var seconds2 = (+b[0]) * 60 * 60 + (+b[1]) * 60 + (+b[2]); 
  
   var date = new Date(1970,0,1);
       date.setSeconds(seconds + seconds2);
  
   var c = date.toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1");
       return c;
       console.log(c);
  }   
  </code></pre>
  
  <p>Yet console.log C returns an Invalid Date. Is this still a string or am I doing something wrong?</p>
  
  <p><a href="https://stackoverflow.com/a/9640384/3317267" title="Source 1">Source 1</a> <a href="https://stackoverflow.com/a/17781037/3317267" title="Source 2">Source 2</a></p>
  
  <p>EDIT: (I was stupid) I had this in a recursive loop and I initialized the sum variable with a <code>var s = 0;</code> instead of a <code>var s = "00:00:00";</code></p>