Creates a new Time instance from hour, minute and second components.

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

@return Time
9601
public static function hms($h, $m = 0, $s = 0, $f = 0)
    {
        $sec = static::hmsf2sec($h, $m, $s, $f);

        return static::sec($sec);
    }
561983
@Pure
	@Inline(value = "(long) (($1).doubleValue() * $2.MILLIS_IN_HOUR)", imported = {TimeExtensions.class})
	public static long hours(Number hours) {
		return (long) (hours.doubleValue() * MILLIS_IN_HOUR);
	}
179078
def from_time(cls, other):
        
        return cls(other.hour, other.minute, other.second, other.microsecond)
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 '+';
        }
    }
592753
public static function create($time = null)
    {

        if (is_string($time)) {
            $time = new self($time);
        }

        if (self::isNullOrBnDateTimeObject($time)) {
            return $time;
        }

        $dateTime = new self();

        if ($time instanceof \DateTime) {
            $dateTime->setTimezone($time->getTimezone());
            $time = $time->getTimestamp();
        }

        $dateTime->setTimestamp($time);
        return $dateTime;
    }
959151
public function setTime( $hour, $minute, $second = 0, $microsecond = 0)
    {
        if( $this->isInfinity() ) {
            return $this;
        }
        $this->microseconds = $microsecond ? (int) $microsecond : 0;
        return parent::setTime( $hour, $minute, $second );
    }
618302
public static function of(int $hour, int $minute, int $second = 0, int $nano = 0) : LocalTime
    {
        Field\HourOfDay::check($hour);
        Field\MinuteOfHour::check($minute);
        Field\SecondOfMinute::check($second);
        Field\NanoOfSecond::check($nano);

        return new LocalTime($hour, $minute, $second, $nano);
    }
370305
public function time($time, $precision = 0)
    {
        $units = 's';
        if ($time < 1e-6) {    // <1us
            $units = 'ns';
            $time *= 1e9;

        } elseif ($time < 1e-3) { // <1ms
            $units = "\xc2\xb5s";
            $time *= 1e6;

        } elseif ($time < 1) { // <1s
            $units = 'ms';
            $time *= 1e3;
        }

        return \round($time, $precision) . ' ' . $units;
    }
853761
public static Time valueOf(String s) {
        int hour;
        int minute;
        int second;
        int firstColon;
        int secondColon;

        if (s == null) throw new java.lang.IllegalArgumentException();

        firstColon = s.indexOf(':');
        secondColon = s.indexOf(':', firstColon+1);
        if ((firstColon > 0) & (secondColon > 0) &
            (secondColon < s.length()-1)) {
            hour = Integer.parseInt(s.substring(0, firstColon));
            minute =
                Integer.parseInt(s.substring(firstColon+1, secondColon));
            second = Integer.parseInt(s.substring(secondColon+1));
        } else {
            throw new java.lang.IllegalArgumentException();
        }

        return new Time(hour, minute, second);
    }
305189
public static long millis(final String time, final String timeUnit) {
      return TIMEUNITS.get(timeUnit).toMillis(Long.parseLong(time));
   }
277131
public double convert(double time, TimeUnit from, TimeUnit to) {
        return time * factorOf(to) / factorOf(from);
    }
18963
public static function create($year=null, $month=null, $day=null, $hour=null, $minute=null, $second=null, $tz=null) {
		$year = ($year === null) ? date('Y') : $year;
		$month = ($month === null) ? date('n') : $month;
		$day = ($day === null) ? date('j') : $day;

		if ($hour === null) {
			$hour = date('G');
			$minute = ($minute === null) ? date('i') : $minute;
			$second = ($second === null) ? date('s') : $second;
		}
		else {
			$minute = ($minute === null) ? 0 : $minute;
			$second = ($second === null) ? 0 : $second;
		}

        return static::createFromFormat('Y-n-j G:i:s', sprintf('%s-%s-%s %s:%02s:%02s', $year, $month, $day, $hour, $minute, $second), $tz);
	}
1065436
def from_native(cls, t):
        
        second = (1000000 * t.second + t.microsecond) / 1000000
        return Time(t.hour, t.minute, second, t.tzinfo)
79358
public static function createGregorianTime($hour = null, $minute = null, $second = null, $timezone = null)
    {
        return static::createGregorian(null, null, null, $hour, $minute, $second, $timezone);
    }
154340
public function setLocalTime($time)
    {
        list($hour, $minute, $second) = explode(':', $time);
        $this->localHour = (int)$hour;
        $this->localMinute = (int)$minute;
        $this->localSecond = (int)$second;
        return $this;
    }
394821
public function convertMicrosecondsToTime($time)
    {
        // Calculating day-ratio;
        // Dividing microseconds per seconds results in the intended value
        $ratio = intval($time / $this->dayLengthInSeconds);

        // If using a different time format, apply ratio
        $timeScale = array_product($this->ranges);

        if ($this->dayLengthInMicroSeconds !== $timeScale) {
            $time = intval(
                ($time * $timeScale) / $this->dayLengthInMicroSeconds
            );
        }

        $len = count($this->ranges);
        $res = array_fill(0, $len, 0);

        for ($i=$len - 1; $i > -1; $i--) {
            $res[$i] = $time % $this->ranges[$i];
            $time = intval($time / $this->ranges[$i]);
        }

        return new TimeObject($res, $this->ranges, $ratio);
    }
215675
public function addInputTime(string $name) : Element\Input\Time
    {
        $input = new Element\Input\Time($this, $name);
        $this->addComponent($name, $input);

        return $input;
    }