Composes h m s into seconds.

@param int        $h Hour component
@param int        $m Minute component
@param int|double $s Second component
@param int|double $f Fractional Second component

@return double
351251
protected static function hmsf2sec($h, $m, $s, $f)
    {
        return static::dmsf2asec($h, $m, $s, $f);
    }
1078591
public static function timeToSec($time)
    {
        // hh:mm:ss
        $split_time = explode(':', $time);
        $hour       = $split_time[0] * 3600;
        $minutes    = $split_time[1] * 60;
        $second     = $split_time[2] * 1;

        $timetosec = (int)($hour + $minutes + $second);

        return $timetosec;
    }
1066820
function timeParamToSeconds(param) {
	var componentValue = function (si) {
		var regex = new RegExp('(\\d+)' + si);
		return param.match(regex) ? parseInt(RegExp.$1, 10) : 0;
	};

	return componentValue('h') * 3600
		+ componentValue('m') * 60
		+ componentValue('s');
}
388068
public static double[] timesMinusTimes(final double[] v1, final double s1, final double[] v2, final double s2) {
    assert v1.length == v2.length : ERR_VEC_DIMENSIONS;
    final double[] sub = new double[v1.length];
    for(int i = 0; i < v1.length; i++) {
      sub[i] = v1[i] * s1 - v2[i] * s2;
    }
    return sub;
  }
192807
public function setHMS($h, $m, $s, $ms = 0)
    {
        if (is_int($h) === false) {
            throw new MWrongTypeException("\$h", "int", gettype($h));
        }

        if (is_int($m) === false) {
            throw new MWrongTypeException("\$m", "int", gettype($m));
        }

        if (is_int($s) === false) {
            throw new MWrongTypeException("\$s", "int", gettype($s));
        }

        if (is_int($ms) === false) {
            throw new MWrongTypeException("\$ms", "int", gettype($ms));
        }

        $this->mseconds = $ms + ($s * 1000) + ($m * 60 * 1000) + ($h * 60 * 60 * 1000);
    }
392408
private static String getDuration(long millis) {
        long tsec = millis / 1000;
        long h = tsec / 60 / 60;
        long m = (tsec - h * 60 * 60) / 60;
        long s = tsec - h * 60 * 60 - m * 60;
        StringBuffer out = new StringBuffer();
        if (h > 0) {
            out.append(h + " hour");
            if (h > 1) {
                out.append('s');
            }
        }
        if (m > 0) {
            if (h > 0) {
                out.append(", ");
            }
            out.append(m + " minute");
            if (m > 1) {
                out.append('s');
            }
        }
        if (s > 0 || h == 0 && m == 0) {
            if (h > 0 || m > 0) {
                out.append(", ");
            }
            out.append(s + " second");
            if (s != 1) {
                out.append('s');
            }
        }
        return out.toString();
    }
819209
protected static function findSign($dh, $m, $s, $f)
    {
        if ($dh != 0) {
            return $dh < 0 ? '-' : '+';
        } elseif ($m != 0) {
            return $m < 0 ? '-' : '+';
        } elseif ($s != 0) {
            return $s < 0 ? '-' : '+';
        } elseif ($f != 0) {
            return $f < 0 ? '-' : '+';
        } else {
            return '+';
        }
    }
894760
def seconds2time(s):
    """"""
    hour, temp = divmod(s, 3600)
    minute, temp = divmod(temp, 60)
    temp, second = math.modf(temp)
    return datetime.time(hour=int(hour), minute=int(minute), second=int(second),
                         microsecond=int(round(temp * 1e6)))
887430
def get_seconds(self):
        
        parsed = self.parse_hh_mm_ss()  # get times
        total_seconds = parsed.second
        total_seconds += parsed.minute * 60.0
        total_seconds += parsed.hour * 60.0 * 60.0
        return total_seconds
1122476
def hms(secs):
    """"""
    hms = [0, 0, 0]
    hms[0] = int(secs // 3600)
    s = secs % 3600
    hms[1] = int(s // 60)
    s = secs % 60
    hms[2] = int(s+.5)
    return hms
1257461
@Pure
	@Inline(value = "(long) (($1).doubleValue() * $2.MILLIS_IN_SECOND)", imported = {TimeExtensions.class})
	public static long seconds(Number secs) {
		return (long) (secs.doubleValue() * MILLIS_IN_SECOND);
	}
301888
function timeCode(seconds, delim = ':') {
    // const h = Math.floor(seconds / 3600);
    // const m = Math.floor((seconds % 3600) / 60);
    const m = Math.floor(seconds / 60);
    const s = Math.floor((seconds % 3600) % 60);
    // const hr = (h < 10 ? '0' + h + delim : h + delim);
    const mn = (m < 10 ? '0' + m : m) + delim;
    const sc = (s < 10 ? '0' + s : s);
    // return hr + mn + sc;
    return mn + sc;
}
1110513
public static function subtractMinute($ts = null, $num = 1)
	{
		return sfTime::subtract($ts, $num, sfTime::MINUTE);
	}
454154
function humanize (ms)
{
	if (ms >= HOUR)
		return (ms / HOUR).toFixed(1) + 'h';
	
	if (ms >= MIN)
		return (ms / MIN).toFixed(1) + 'm';
	
	if (ms >= SEC) 
		return (ms / SEC | 0) + 's';
	
	return ms + 'ms';
}
216659
def seconds_to_hms(seconds):
    
    hours = int(seconds / 3600.0)
    minutes = int((seconds / 60.0) % 60.0)
    secs = float(seconds % 60.0)
    return "{0:02d}:{1:02d}:{2:02.6f}".format(hours, minutes, secs)
800069
public static function secondsTo($unit, $seconds)
    {
        $method = $unit.'ToSeconds';

        return  (float) $seconds / (float) self::$method();
    }
110512
protected static function dmsf2asec($d, $m, $s, $f)
    {
        // Find the sign.
        $sign = static::findSign($d, $m, $s, $f);

        // Cast to integers.
        $d = (int)$d;
        $m = (int)$m;

        if ($f) {
            // If fraction is present, seconds should be cast to int.
            $s = (int)$s;

            if ($f >= 1) {
                // Fix for fraction given as integer instead of fraction.
                $f = (double)('0.' . (int)$f);
            }
        }

        // Calculate arcseconds
        $asec = (abs($d) * 3600) + (abs($m) * 60) + abs($s) + abs($f);

        //dd($asec, $d, $m, $s, $f);

        // Return arcseconds with appropriate sign.
        return $sign == '-' ? -1 * $asec : $asec;
    }