Creates a LocalTime instance from a number of seconds since midnight.

@param int $secondOfDay  The second-of-day, from 0 to 86,399.
@param int $nanoOfSecond The nano-of-second, from 0 to 999,999,999.

@return LocalTime

@throws DateTimeException
502552
public static function ofSecondOfDay(int $secondOfDay, int $nanoOfSecond = 0) : LocalTime
    {
        Field\SecondOfDay::check($secondOfDay);
        Field\NanoOfSecond::check($nanoOfSecond);

        $hours = \intdiv($secondOfDay, self::SECONDS_PER_HOUR);
        $secondOfDay -= $hours * self::SECONDS_PER_HOUR;
        $minutes = \intdiv($secondOfDay, self::SECONDS_PER_MINUTE);
        $secondOfDay -= $minutes * self::SECONDS_PER_MINUTE;

        return new LocalTime($hours, $minutes, $secondOfDay, $nanoOfSecond);
    }
288248
public function negated() : Duration
    {
        if ($this->isZero()) {
            return $this;
        }

        $seconds = -$this->seconds;
        $nanos = $this->nanos;

        if ($nanos !== 0) {
            $nanos = LocalTime::NANOS_PER_SECOND - $nanos;
            $seconds--;
        }

        return new Duration($seconds, $nanos);
    }
1286352
public function toSecondOfDay() : int
    {
        return $this->hour * self::SECONDS_PER_HOUR
            + $this->minute * self::SECONDS_PER_MINUTE
            + $this->second;
    }
1193124
public static function fromFormat(string $format, string $timeString) : TimeOfDay
    {
        return self::fromNative(\DateTimeImmutable::createFromFormat($format, $timeString));
    }
236269
public static function check(int $secondOfMinute) : void
    {
        if ($secondOfMinute < 0 || $secondOfMinute > 59) {
            throw DateTimeException::fieldNotInRange(self::NAME, $secondOfMinute, 0, 59);
        }
    }
1047297
public function toDateTime() : \DateTime
    {
        $second = $this->localDateTime->getSecond();

        // round down to the microsecond
        $nano = $this->localDateTime->getNano();
        $nano = 1000 * intdiv($nano, 1000);

        $dateTime = (string) $this->localDateTime->withNano($nano);
        $dateTimeZone = $this->timeZone->toDateTimeZone();

        $format = 'Y-m-d\TH:i';

        if ($second !== 0 || $nano !== 0) {
            $format .= ':s';

            if ($nano !== 0) {
                $format .= '.u';
            }
        }

        return \DateTime::createFromFormat($format, $dateTime, $dateTimeZone);
    }
271766
public static int[] getElapsedTime(Date first, Date second) {
         if (first.compareTo(second) == 1 ) {
            return null;
         }
         int difDays = 0;
         int difHours = 0;
         int difMinutes = 0;

         Calendar c = Calendar.getInstance();
         c.setTime(first);
         int h1 = c.get(Calendar.HOUR_OF_DAY);
         int m1 = c.get(Calendar.MINUTE);

         c.setTime(second);
         int h2 = c.get(Calendar.HOUR_OF_DAY);
         int m2 = c.get(Calendar.MINUTE);

         if (sameDay(first, second)) {
             difHours = h2 - h1;
         } else {
             difDays = getNumberOfDays(first, second)-1;
             if (h1 >= h2) {
                difDays--;
                difHours = (24 - h1) + h2;
             } else {
                difHours = h2 - h1;
             }
         }

         if (m1 >= m2) {
             difHours--;
             difMinutes = (60 - m1) + m2;
         } else {
             difMinutes = m2 - m1;
         }

         int[] result = new int[3];
         result[0] = difDays;
         result[1] = difHours;
         result[2] = difMinutes;
         return result;
     }
53019
public static function compareDateWithHourMinuteSecond($date, $hour, $minute, $second = 0)
    {
        $date1 = DateTime::createFromFormat('Y-m-d H:i:s', sprintf('2000-01-01 %02d:%02d:%02d', $hour, $minute, $second));

        return self::compareTimeWithoutDate($date, $date1);
    }
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 );
    }
1009148
public function withEpochSecond(int $epochSecond) : Instant
    {
        if ($epochSecond === $this->epochSecond) {
            return $this;
        }

        return new Instant($epochSecond, $this->nano);
    }
435750
public function withDay(int $day) : LocalDate
    {
        if ($day === $this->day) {
            return $this;
        }

        Field\DayOfMonth::check($day, $this->month, $this->year);

        return new LocalDate($this->year, $this->month, $day);
    }
1340044
def hydrate_datetime(seconds, nanoseconds, tz=None):
    
    minutes, seconds = map(int, divmod(seconds, 60))
    hours, minutes = map(int, divmod(minutes, 60))
    days, hours = map(int, divmod(hours, 24))
    seconds = (1000000000 * seconds + nanoseconds) / 1000000000
    t = DateTime.combine(Date.from_ordinal(UNIX_EPOCH_DATE_ORDINAL + days), Time(hours, minutes, seconds))
    if tz is None:
        return t
    if isinstance(tz, int):
        tz_offset_minutes, tz_offset_seconds = divmod(tz, 60)
        zone = FixedOffset(tz_offset_minutes)
    else:
        zone = timezone(tz)
    return zone.localize(t)
1065436
def from_native(cls, t):
        
        second = (1000000 * t.second + t.microsecond) / 1000000
        return Time(t.hour, t.minute, second, t.tzinfo)
1171749
public function withMinute(int $minute) : LocalTime
    {
        if ($minute === $this->minute) {
            return $this;
        }

        Field\MinuteOfHour::check($minute);

        return new LocalTime($this->hour, $minute, $this->second, $this->nano);
    }
624468
public function plusSeconds(int $seconds) : Instant
    {
        if ($seconds === 0) {
            return $this;
        }

        return new Instant($this->epochSecond + $seconds, $this->nano);
    }
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;
    }
1178306
public function withDay(int $day) : LocalDateTime
    {
        $date = $this->date->withDay($day);

        if ($date === $this->date) {
            return $this;
        }

        return new LocalDateTime($date, $this->time);
    }