Return a new Frame from by time interval.

@param TimeInterval|int|float $interval

@return Frame
965145
public function getFrame($interval)
	{
		if ( ! $interval instanceof TimeInterval)
		{
			$interval = new TimeInterval($interval);
		}
		
		if ($interval->getSeconds() > $this->getDuration())
		{
			throw new \OutOfRangeException('The interval may not be a more than '.$this->getDuration());
		}
		
		$frame = new Frame($this->getFilePath(), $this->getService());
		$frame->addFilter(new SimpleFilter(['seek_start' => $interval->__toString()]), 99);
		
		return $frame;
	}
429845
private static function dateIntervalToString(\DateInterval $interval)
    {

        // Reading all non-zero date parts.
        $date = array_filter([
            'Y' => $interval->y,
            'M' => $interval->m,
            'D' => $interval->d,
        ]);

        // Reading all non-zero time parts.
        $time = array_filter([
            'H' => $interval->h,
            'M' => $interval->i,
            'S' => $interval->s,
        ]);

        $specString = 'P';

        // Adding each part to the spec-string.
        foreach ($date as $key => $value) {
            $specString .= $value.$key;
        }
        if (count($time) > 0) {
            $specString .= 'T';
            foreach ($time as $key => $value) {
                $specString .= $value.$key;
            }
        }

        return $specString;
    }
31603
public static MomentInterval from(ChronoInterval<Moment> interval) {

        if (interval instanceof MomentInterval) {
            return MomentInterval.class.cast(interval);
        } else {
            return new MomentInterval(interval.getStart(), interval.getEnd());
        }

    }
870406
public function applyDateInterval($interval, $unit)
    {
        if ($interval > 0) {
            $this->add(new RhubarbDateInterval("P{$interval}{$unit}"));
        } elseif ($interval < 0) {
            $interval *= -1;
            $this->sub(new RhubarbDateInterval("P{$interval}{$unit}"));
        }
    }
60601
public static function time(Time $time, Time $interval = null)
    {
        $secInDay = Time::days(1)->sec;
        $interval = $interval ? $interval->sec : $secInDay;

        return static::deg($time->sec / $interval * 360);
    }
310354
public function getTotalTimestampInterval(): float
    {
        $retval = 0;
        foreach ($this->intervals as $interval) {
            $retval += $interval->getTimestampInterval();
        }

        return $retval;
    }
1268410
public function sub(DateInterval $interval)
	{
		return $this->modify(
			function (\DateTime $datetime) use ($interval)
			{
				$datetime->sub($interval->getDateInterval());
			}
		);
	}
209814
public static function intervalToTime(DateInterval $interval)
    {
        $time = null;

        if (!is_null($interval)) {
            $format = property_exists(get_class($interval), 'u') ? '%H:%I:%S.%U' : '%H:%I:%S';
            $time = $interval->format($format);
        }

        return $time;
    }
1229516
public Observable<Long> getTickObservable(int interval, boolean intermediate) {
        return Observable.interval(intermediate ? 0 : interval, interval, TimeUnit.SECONDS);
    }
136692
public function withIntervalInDays($intervalInDays)
    {
        $this->validateInterval($intervalInDays);
        $this->interval = $intervalInDays;
        $this->intervalUnit = IntervalUnit::DAY;

        return $this;
    }
394328
public function withIntervalInSeconds($intervalInSeconds)
    {
        $this->validateInterval($intervalInSeconds);

        $this->interval = $intervalInSeconds;
        $this->intervalUnit = IntervalUnit::SECOND;

        return $this;
    }
645318
public static function createFromDateString($time)
    {
        $interval = parent::createFromDateString($time);
        if ($interval instanceof DateInterval && !($interval instanceof static)) {
            $interval = static::instance($interval);
        }

        return static::instance($interval);
    }
487725
public function add($interval)
    {
        parent::add($interval);

        if ($interval instanceof DateInterval) {
            if ($interval->invert) { // is negative, then sub
                $this->subMicroseconds($interval->u);
            } else {
                $this->addMicroseconds($interval->u);
            }
        }

        return $this;
    }
248895
public static function createIntervalFromSpec($interval_spec)
	{
		return	isset(static::$intervals[$interval_spec])
				?	static::$intervals[$interval_spec]
				:	static::$intervals[$interval_spec] = new \DateInterval($interval_spec);
	}
1227191
public function add($interval) : self
    {
        $instance = clone $this;
        
        $instance->date->add(self::resolveDateInterval($interval));
        
        return $instance;
    }
507713
public function withIntervalInWeeks($intervalInWeeks)
    {
        $this->validateInterval($intervalInWeeks);
        $this->interval = $intervalInWeeks;
        $this->intervalUnit = IntervalUnit::WEEK;

        return $this;
    }
1138768
protected function dateIntervalToSeconds($interval): int
    {
        $now = time();
        $dt = new \DateTime();
        $dt->add($interval);
        $ts = $dt->getTimestamp();
        $diff = $ts - $now;
        return $diff;
    }