Conversão de hora para o formato que definir (Hora, Minuto, Segundo)
@param  time    $time
@param  string  $conversion
@param  boolean $debub
@return double
4561
public static function convertTime($time, $conversion, $debub = false) {
        list ($hora, $minuto, $segundo) = explode(":", $time);
        switch (strtolower($conversion)) {
            case 'h':
                $resultH = $hora * 1;
                $resultM = $minuto / 60;
                $resultS = $segundo / 60;
                break;
            case 'm':
                $resultH = $hora * 60;
                $resultM = $minuto * 1;
                $resultS = $segundo / 60;
                break;
            case 's':
                $resultH = $hora * 60;
                $resultM = $minuto * 60;
                $resultS = $segundo * 1;
                break;
        }

        $result = Cityware_Format_Mask::formataValor(($resultH + $resultM + $resultS), ".", 2, ".", "");

        if ($debub) {
            echo "Hora: " . $resultH . " Minuto: " . $resultM . " Segundo: " . $resultS . " Total: " . $result . "<br>";
        }

        return $result;
    }
1132061
protected function microTime($time): int
    {
        if ($time === null) {
            return $this->timestampMicro();
        }

        if ($time instanceof \DateTimeInterface) {
            return (int)round($time->format('U.u') * 1000000, 0);
        }

        if (is_int($time)) {
            return $time;
        }

        if (is_float($time)) {
            return (int)round($time * 1000000, 0);
        }

        throw new \InvalidArgumentException(sprintf(
            'Time should be one of the types int|float|DateTime|null, got %s.',
            gettype($time)
        ));
    }
388204
public static function convertInto(float $time, string $unit, string $destUnit)
    {
        if (!$time) {
            return 0;
        }

        self::validateUnit($unit);
        self::validateUnit($destUnit);

        $destMultiplier = self::$map[$destUnit];
        $sourceMultiplier = self::$map[$unit];

        $time = $destMultiplier / ($time * $sourceMultiplier);

        return $time;
    }
693233
public static function toStamp($time = null, $currentIsDefault = true): int
    {
        if ($time instanceof DateTime) {
            return $time->format('U');
        }

        if (null !== $time) {
            $time = is_numeric($time) ? (int)$time : strtotime($time);
        }

        if (!$time) {
            $time = $currentIsDefault ? time() : 0;
        }

        return $time;
    }
1149904
protected function getInterval($fromTime, $toTime = null)
    {
        $fromTime = new DateTime($this->normalizeDate($fromTime));
        $toTime   = new DateTime($this->normalizeDate($toTime));

        return $fromTime->diff($toTime);
    }
277131
public double convert(double time, TimeUnit from, TimeUnit to) {
        return time * factorOf(to) / factorOf(from);
    }
1366730
public function toDestUnit(float $time, string $destUnit = null, string $mode = null)
    {
        return self::convert($time, $this->sourceUnit, $this->getDestUnit($destUnit), $this->getMode($mode));
    }
867029
public function diffInSeconds(Date $dt = null, $abs = true)
    {
        $dt = $dt ?: static::now($this->getTimezone());
        $value = $dt->getTimestamp() - $this->getTimestamp();

        return $abs ? abs($value) : $value;
    }
1065692
public function getTimestampDifference($time = null)
    {
        $time = (is_null($time)) ? $this->getCurrentTimestamp() : $time;

        return ($time - $this->initialTimestamp);
    }
98382
public function getFormattedTime(
        $time,
        $precision = 0,
        $floatingPrecision = 3,
        $showUnit = true
    ) {

        $test = is_int(
                $precision
            ) && $precision >= 0 && $precision <= 2 &&
            is_float($time) &&
            is_int($floatingPrecision) && $floatingPrecision >= 0 &&
            is_bool($showUnit);

        if ($test) {
            $duration = round($time * 10 * ($precision * 3), $floatingPrecision);

            if ($showUnit) {
                switch ($precision) {
                    case 0 :
                        return $duration . ' s';
                    case 1 :
                        return $duration . ' ms';
                    case 2 :
                        return $duration . ' µs';
                    default :
                        return $duration . ' (no unit)';
                }
            } else {
                return $duration;
            }
        } else {
            return 'Can\'t return the render time';
        }
    }
605471
public static function createFromFormat($time, $format = null)
    {
        if (self::isNull($format)) {
            $format = self::$defaultFormat;
        }

        try {
            $date = \DateTime::createFromFormat($format, $time);
            if (!$date) {
                throw new DateTimeObjectException(DateTimeObjectException::MSG_UNABLE_TO_CREATE_FROM_FORMAT);
            }
        } catch (\Exception $e) {
            throw new DateTimeObjectException(DateTimeObjectException::MSG_UNABLE_TO_CREATE_FROM_FORMAT);
        }

        try {
            $dt = new DateTimeObject();
            $dt->setTimestamp($date->getTimestamp());
            $dt->setFormat($format);
        } catch (\Exception $e) {
            throw new DateTimeObjectException(DateTimeObjectException::MSG_UNABLE_TO_CREATE_FROM_FORMAT);
        }

        return $dt;
    }
519882
public function convertTime($timestamp)
    {
        $ts = new BigNumber($timestamp, 20);
        $ts->subtract('122192928000000000');
        $ts->divide('10000000.0');
        $ts->round();

        return $ts->getValue();
    }
70696
public static function elapsedTime($timestamp)
    {
        // @todo: deprecated - use timeDiff instead of this

        $dateDiff = self::timeDiff($timestamp);

        unset ($dateDiff['month']);

        $dateDiff['week'] = floor($dateDiff['days_total'] / 7);
        $dateDiff['day']  = $dateDiff['days_total'] % 7;

        return $dateDiff;
    }
99429
public function diffInHours(Time $dt = null, $abs = true)
        {
            return (int) ($this->diffInSeconds($dt, $abs) / self::SECONDS_PER_MINUTE / self::MINUTES_PER_HOUR);
        }
37478
public function offsetDatetime($time = null, $offset = 0)
    {
        if ($this->timeFormat === static::$timeFormatDatetime) {
            return date('Y-m-d H:i:s', strtotime(($offset >= 0 ? "+$offset" : $offset) . " seconds", is_string($time) ? strtotime($time) : (is_int($time) ? $time : time())));
        }
        if ($this->timeFormat === static::$timeFormatTimestamp) {
            return (is_int($time) ? $time : time()) + $offset;
        }
        return null;
    }
1033198
public static function inPast($date, $time = null)
    {
        if (is_null($time)) {
            $time = self::time();
        }
        if (!is_int($date)) {
            $date = self::strtotime($date);
        }

        return $time > $date;
    }
1199424
public function diffInMinutes(Date $dt = null, $abs = true)
    {
        return (int) ($this->diffInSeconds($dt, $abs) / static::SECONDS_PER_MINUTE);
    }