Converts seconds into youtube t-param value, e.g. 1h4m30s
499707
function secondsToTimeParam(seconds) {
	var h = Math.floor(seconds / 3600);
	var m = Math.floor((seconds / 60) % 60);
	var s = seconds % 60;
	var param = '';

	if (h > 0) {
		param += h + 'h';
	}

	if (m > 0) {
		param += m + 'm';
	}

	if (s > 0) {
		param += s + 's';
	}

	return param;
}
1069508
def seconds_to_iso(value)
      return self.class.new('PT0S') if value.zero?

      sign_str = value < 0 ? '-' : ''
      value = value.abs

      y, y_mod = decompose_atom(value, years)
      m, m_mod = decompose_atom(y_mod, months)
      d, d_mod = decompose_atom(m_mod, days)
      h, h_mod = decompose_atom(d_mod, hours)
      mi, mi_mod = decompose_atom(h_mod, minutes)
      s = Seconds.new(mi_mod)

      date = to_date_s(sign_str, y, m, d)
      time = to_time_s(h, mi, s)

      self.class.new(date + time)
    end
430375
def _to_seconds(timestr):
    '''
    
    '''
    timestr = timestr.upper()
    if 'H' in timestr:
        seconds = int(timestr.replace('H', '')) * 3600
    elif 'D' in timestr:
        seconds = int(timestr.replace('D', '')) * 86400
    elif 'W' in timestr:
        seconds = 604800
    else:
        try:
            seconds = int(timestr)
        except ValueError:
            seconds = 604800
    if seconds > 604800:
        seconds = 604800
    return seconds
904722
def TimeToSecondsSinceMidnight(time_string):
  """"""
  m = re.match(r'(\d{1,3}):([0-5]\d):([0-5]\d)$', time_string)
  # ignored: matching for leap seconds
  if not m:
    raise errors.Error('Bad HH:MM:SS "%s"' % time_string)
  return int(m.group(1)) * 3600 + int(m.group(2)) * 60 + int(m.group(3))
746170
def _convert_seconds(self, packed_seconds):
        """"""
        seconds = struct.unpack("!H", packed_seconds[:2])[0]
        seconds += struct.unpack("!I", packed_seconds[2:])[0]
        return seconds
363466
def to_s
      return "" if @seconds.nil?

      hours, seconds = @seconds.divmod(Hour.to_seconds(1))
      minutes = seconds / Minute.to_seconds(1)
      sprintf("%d:%02d", hours, minutes)
    end
770502
def duration_to_string(duration):
    

    m, s = divmod(duration, 60)
    h, m = divmod(m, 60)
    return "%d:%02d:%02d" % (h, m, s)
884496
def _string2Duration(text):
    
    if text == "" or text == "zero":
        return ZERO

    amount, interval = re.match(r"([\d\.]*)(.*)", text).groups()
    amount = int(amount) if amount else 1

    if MILLI_VALUES[interval] == None:
        from mo_logs import Log
        Log.error(
            "{{interval|quote}} in {{text|quote}} is not a recognized duration type (did you use the pural form by mistake?",
            interval=interval,
            text=text
        )

    output = Duration(0)
    if MONTH_VALUES[interval] == 0:
        output.milli = amount * MILLI_VALUES[interval]
    else:
        output.milli = amount * MONTH_VALUES[interval] * MILLI_VALUES.month
        output.month = amount * MONTH_VALUES[interval]

    return output
226620
function extractMilliseconds(vValue) {
		if (typeof vValue === "string" && rTime.test(vValue)) {
			vValue = parseInt(RegExp.$1) * 3600000 +
				parseInt(RegExp.$2) * 60000 +
				parseInt(RegExp.$3) * 1000;
		}
		if (vValue instanceof Date) {
			return vValue.getTime();
		}
		if (vValue && vValue.__edmType === "Edm.Time") {
			return vValue.ms;
		}
		return vValue;
	}
48904
def stringify_seconds(seconds=0):
    
    seconds = int(seconds)
    minutes = seconds / 60
    ti = {'h': 0, 'm': 0, 's': 0}

    if seconds > 0:
        ti['s'] = seconds % 60
        ti['m'] = minutes % 60
        ti['h'] = minutes / 60

    return "%dh %dm %ds" % (ti['h'], ti['m'], ti['s'])
767883
def to_seconds(value, strict=True, force_int=True):
    
    if isinstance(value, int):
        return value  # assuming it's seconds
    elif isinstance(value, timedelta):
        seconds = value.total_seconds()
        if force_int:
            seconds = int(round(seconds))
        return seconds
    elif isinstance(value, str):
        hours, minutes, seconds = _parse(value, strict)
    elif isinstance(value, tuple):
        check_tuple(value, strict)
        hours, minutes, seconds = value
    else:
        raise TypeError(
            'Value %s (type %s) not supported' % (
                value, type(value).__name__
            )
        )

    if not (hours or minutes or seconds):
        raise ValueError('No hours, minutes or seconds found')

    result = hours*3600 + minutes*60 + seconds
    return result
431047
def time2string(tstamp, micro=True):
    """"""
    tformat = TIME_FORMAT if micro else TIME_FORMAT[:-len(MICRO)]
    return tstamp.strftime(tformat)
903610
def seconds(value)
      result = if value >= 60 * 60
                 "#{value / 60 / 60}:#{Kernel.format('%02i', (value / 60) % 60)}"
               else
                 (value / 60).to_s
               end

      result + ':' + Kernel.format('%02i', value % 60)
    end
418974
def to_python(self, value):
        ''''''
        if isinstance(value, Seconds):
            return value
        if value in self.empty_values:
            return None
        return self.parse_seconds(value)
808562
def ToTimedelta(self):
    """"""
    return timedelta(
        seconds=self.seconds, microseconds=_RoundTowardZero(
            self.nanos, _NANOS_PER_MICROSECOND))
377001
def get_formatted_time(seconds: float) -> str:
    
    seconds = round(seconds)
    m, s = divmod(seconds, 60)
    h, m = divmod(m, 60)
    return '{:d}:{:02d}:{:02d}'.format(h, m, s)
441965
function getYTVideoID(url) {
      var regexp = /(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/ ]{11})/i;
      var match = url.match(regexp);
      return match && match.length === 2 ? match[1] : false;
    }