src/precore/util/concurrent/TimeUnit.php
public function toDateInterval(float $duration) : DateInterval
    {
        Preconditions::checkState($this->dateIntervalFormat !== null, '[%s] does not support toDateInterval()', $this);
        return new DateInterval(sprintf($this->dateIntervalFormat, $duration));
    }
public function toDateInterval(float $duration) : DateInterval
    {
        Preconditions::checkState($this->dateIntervalFormat !== null, '[%s] does not support toDateInterval()', $this);
        return new DateInterval(sprintf($this->dateIntervalFormat, $duration));
    }
public function toDateInterval ( float $ duration ) : DateInterval { Preconditions :: checkState ( $ this -> dateIntervalFormat !== null , '[%s] does not support toDateInterval()' , $ this ) ; return new DateInterval ( sprintf ( $ this -> dateIntervalFormat , $ duration ) ) ; }
Creates a DateInterval with the given duration and this unit.

@param $duration float
@throws \Exception if this object does not have proper DateInterval format string
@return DateInterval
Creates a DateInterval with the given duration and this unit .