code: function hmsToSeconds(time) {
  	var arr = time.split(':'), s = 0, m = 1;
  
  	while (arr.length > 0) {
  		s += m * parseInt(arr.pop(), 10);
  		m *= 60;
  	}
  
  	return s;
  }
docs: Converts time in hms format to seconds only