Returns a copy of this LocalTime with the nano-of-second value altered.

@param int $nano The new nano-of-second.

@return LocalTime

@throws DateTimeException If the nano-of-second if not valid.
471
public function withNano(int $nano) : LocalTime
    {
        if ($nano === $this->nano) {
            return $this;
        }

        Field\NanoOfSecond::check($nano);

        return new LocalTime($this->hour, $this->minute, $this->second, $nano);
    }
859392
public function compareTo(LocalTime $that) : int
    {
        $seconds = $this->toSecondOfDay() - $that->toSecondOfDay();

        if ($seconds !== 0) {
            return $seconds > 0 ? 1 : -1;
        }

        $nanos = $this->nano - $that->nano;

        if ($nanos !== 0) {
            return $nanos > 0 ? 1 : -1;
        }

        return 0;
    }
922429
protected function dateTime(): DateTimeImmutable
    {
        if ($this->dateTime === null) {
            $year = $this->year();
            $month = $this->month();
            $day = $this->day();
            $hour = $this->hour();
            $minute = $this->minute();
            $second = $this->second();
            $timezone = $this->timezone()->toString();
            $this->dateTime = self::createNative($year, $month, $day, $hour, $minute, $second, $timezone);
        }

        return $this->dateTime;
    }
631949
public static function GetCurrentDateTime( $context )
	{
		$res = DateTimeValue::fromDate( false, new \DateTime( "@" . $context->RunningContext->now ) );
		$res->Value->microseconds = 0;
		$res->IsLocal = false;
		return $res;
	}
774184
final public function getDate(): ?\DateTimeImmutable
    {
        /** @var null|string $dateHeader */
        $dateHeader = $this->getHeaders()->get('date');
        if (null === $dateHeader) {
            return null;
        }

        $alteredValue = $dateHeader;
        $alteredValue = \str_replace(',', '', $alteredValue);
        $alteredValue = (string) \preg_replace('/^[a-zA-Z]+ ?/', '', $alteredValue);
        $alteredValue = (string) \preg_replace('/ +\(.*\)/', '', $alteredValue);
        $alteredValue = (string) \preg_replace('/\bUT\b/', 'UTC', $alteredValue);
        if (0 === \preg_match('/\d\d:\d\d:\d\d.* [\+\-]\d\d:?\d\d/', $alteredValue)) {
            $alteredValue .= ' +0000';
        }

        try {
            $date = new \DateTimeImmutable($alteredValue);
        } catch (\Throwable $ex) {
            throw new InvalidDateHeaderException(\sprintf('Invalid Date header found: "%s"', $dateHeader), 0, $ex);
        }

        return $date;
    }
1311426
public function getLastModified(): \DateTime
    {
        \clearstatcache();
        if (false === $mtime = \filemtime($this->filename)) {
            throw new TimeCanNotBeReadException('Last modification time can not be read.');
        }
        return (new \DateTime())->setTimestamp($mtime);
    }
920137
public function toASN1(): TimeType
    {
        $dt = $this->_dt;
        switch ($this->_type) {
            case Element::TYPE_UTC_TIME:
                return new UTCTime($dt);
            case Element::TYPE_GENERALIZED_TIME:
                // GeneralizedTime must not contain fractional seconds
                // (rfc5280 4.1.2.5.2)
                if ($dt->format("u") != 0) {
                    // remove fractional seconds (round down)
                    $dt = self::_roundDownFractionalSeconds($dt);
                }
                return new GeneralizedTime($dt);
        }
        throw new \UnexpectedValueException(
            "Time type " . Element::tagToName($this->_type) . " not supported.");
    }
488474
public final function setMinute( int $minute = null )
      : DateTime
   {

      if ( \is_null( $minute ) )
      {
         $minute = static::CurrentMinute();
      }

      return $this->setTimeParts( null, $minute );

   }
593137
public static function fromNativeDateTime(\DateTime $time)
    {
        $hour   = \intval($time->format('G'));
        $minute = \intval($time->format('i'));
        $second = \intval($time->format('s'));

        return static::fromNative($hour, $minute, $second);
    }
1140301
public function setTime($hour, $minute, $second = 0)
    {
        return $this->fixForChaining($this->dateTime->setTime($hour, $minute, $second));
    }
1152387
public function plusSeconds(int $seconds) : LocalTime
    {
        if ($seconds === 0) {
            return $this;
        }

        $sofd = $this->hour * self::SECONDS_PER_HOUR + $this->minute * self::SECONDS_PER_MINUTE + $this->second;
        $newSofd = (($seconds % self::SECONDS_PER_DAY) + $sofd + self::SECONDS_PER_DAY) % self::SECONDS_PER_DAY;

        if ($sofd === $newSofd) {
            return $this;
        }

        $hour = \intdiv($newSofd, self::SECONDS_PER_HOUR);
        $minute = \intdiv($newSofd, self::SECONDS_PER_MINUTE) % self::MINUTES_PER_HOUR;
        $second = $newSofd % self::SECONDS_PER_MINUTE;

        return new LocalTime($hour, $minute, $second, $this->nano);
    }
847944
public function withHour(int $hour) : LocalDateTime
    {
        $time = $this->time->withHour($hour);

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

        return new LocalDateTime($this->date, $time);
    }
105573
public function diff($time) : DateInterval
    {
        $tmp = new self($time);

        return new DateInterval(abs($this->time - $tmp->getUnixTstamp()));
    }
375274
public static function getMicroTime()
    {
        $returnValue = (float) 0.0;

        
        
        list($ms, $s) = explode(" ", microtime());
        $returnValue = $s+$ms;
        
        

        return (float) $returnValue;
    }
2626
public function withDate(LocalDate $date) : LocalDateTime
    {
        if ($date->isEqualTo($this->date)) {
            return $this;
        }

        return new LocalDateTime($date, $this->time);
    }
768491
public function compareTo(Duration $that) : int
    {
        $seconds = $this->seconds - $that->seconds;

        if ($seconds !== 0) {
            return $seconds > 0 ? 1 : -1;
        }

        $nanos = $this->nanos - $that->nanos;

        if ($nanos !== 0) {
            return $nanos > 0 ? 1 : -1;
        }

        return 0;
    }
1356973
public function compareTo(Instant $that) : int
    {
        $seconds = $this->getEpochSecond() - $that->getEpochSecond();

        if ($seconds !== 0) {
            return $seconds > 0 ? 1 : -1;
        }

        $nanos = $this->getNano() - $that->getNano();

        if ($nanos !== 0) {
            return $nanos > 0 ? 1 : -1;
        }

        return 0;
    }