public function inRange(TimePoint $expiration, TimePoint $creation = null, $skew = null): bool
    {
        $now = $this->read();

        if ($skew !== null) {
            if ($creation instanceof TimePoint) {
                $creation = $creation->modify(sprintf('-%s', $skew));
            }

            $expiration = $expiration->modify(sprintf('+%s', $skew));
        }

        return $now->compare($expiration) !== 1 && (!$creation instanceof TimePoint || $now->compare($creation) !== -1);
    }
public function inRange(TimePoint $expiration, TimePoint $creation = null, $skew = null): bool
    {
        $now = $this->read();

        if ($skew !== null) {
            if ($creation instanceof TimePoint) {
                $creation = $creation->modify(sprintf('-%s', $skew));
            }

            $expiration = $expiration->modify(sprintf('+%s', $skew));
        }

        return $now->compare($expiration) !== 1 && (!$creation instanceof TimePoint || $now->compare($creation) !== -1);
    }
public function inRange ( TimePoint $ expiration , TimePoint $ creation = null , $ skew = null ) : bool { $ now = $ this -> read ( ) ; if ( $ skew !== null ) { if ( $ creation instanceof TimePoint ) { $ creation = $ creation -> modify ( sprintf ( '-%s' , $ skew ) ) ; } $ expiration = $ expiration -> modify ( sprintf ( '+%s' , $ skew ) ) ; } return $ now -> compare ( $ expiration ) !== 1 && ( ! $ creation instanceof TimePoint || $ now -> compare ( $ creation ) !== - 1 ) ; }
Check that the current time is within a specified range

Optionally, a strtotime() compatible skew modifier may be provided. This modifier allows for a certain amount
of clock skew between systems when performing the range check.

@param TimePoint $expiration
@param TimePoint|null $creation
@param string|null $skew

@throws Exception

@return bool
Check that the current time is within a specified range