src/Viserio/Component/Cron/Cron.php
protected function inTimeInterval(string $startTime, string $endTime): Closure
    {
        if ($this->isMidnightBetween($startTime, $endTime)) {
            $endTime .= ' +1 day';
        }

        return function () use ($startTime, $endTime) {
            return Chronos::now($this->timezone)->between(
                Chronos::parse($startTime, $this->timezone),
                Chronos::parse($endTime, $this->timezone)
            );
        };
    }
protected function inTimeInterval(string $startTime, string $endTime): Closure
    {
        if ($this->isMidnightBetween($startTime, $endTime)) {
            $endTime .= ' +1 day';
        }

        return function () use ($startTime, $endTime) {
            return Chronos::now($this->timezone)->between(
                Chronos::parse($startTime, $this->timezone),
                Chronos::parse($endTime, $this->timezone)
            );
        };
    }
Schedule the cron job to run between start and end time.

@param string $startTime
@param string $endTime

@return \Closure