Creates a DateRange object from the start date for the given amount of days.

@param   Date     $start   The start date.
@param   integer  $amount  The amount of dates included in a range.

@return  DateRange

@since   2.0.0
430847
public static function from(Date $start, $amount)
	{
		return self::cast(DateTimeRange::from(new DateTime($start), $amount, new DateInterval('P1D')));
	}
1031682
protected function modifyDays($amount, $invert = false)
        {
            $interval = new \DateInterval("P{$amount}D");

            $this->modifyFromInterval($interval, $invert);

            return $this;
        }
352515
public function setStart($start)
    {
        Argument::i()->test(1, 'int');
        
        if ($start < 0) {
            $start = 0;
        }
        
        $this->start = $start;
        
        return $this;
    }
1018712
public static java.util.Date rollDateTime(java.util.Date startDate, int period, int amount) {
        GregorianCalendar gc = new GregorianCalendar();
        gc.setTime(startDate);
        gc.add(period, amount);
        return new java.util.Date(gc.getTime().getTime());
    }
613675
public function getrange($key, $start, $end) {
        return $this->returnCommand(['GETRANGE'], $key, [$key, $start, $end]);
    }
405352
public function setDates($start, $end)
    {
        $this->setStartDate($start);
        $this->setEndDate($end);

        return $this;
    }
113082
public function setRange(string $rangeStart = null, string $rangeEnd = null): Matomo
    {
        $this->_date = '';
        $this->_rangeStart = $rangeStart;
        $this->_rangeEnd = $rangeEnd;

        if (is_null($rangeEnd)) {
            if (strpos($rangeStart, 'last') !== false || strpos($rangeStart, 'previous') !== false) {
                $this->setDate($rangeStart);
            } else {
                $this->_rangeEnd = self::DATE_TODAY;
            }
        }

        return $this;
    }
754689
protected function setNewPeriod($interval = '', $interval_count = '', $start = '')
    {
        if (empty($interval)) {
            $interval = $this->plan->interval;
        }

        if (empty($interval_count)) {
            $interval_count = $this->plan->interval_count;
        }

        $period = new Period($interval, $interval_count, $start);

        $this->starts_at = $period->getStartDate();
        $this->ends_at = $period->getEndDate();

        return $this;
    }
1055023
Duration addDays(final int amount) {
        Duration duration;
        if (amount < 0) {
            duration = getDatatypeFactory().newDuration(false, 0, 0, Math.abs(amount), 0, 0, 0);
        } else {
            duration = getDatatypeFactory().newDuration(true, 0, 0, amount, 0, 0, 0);
        }
        return duration;
    }
1172711
public static function DateRangeDiff(string $from, string $to)
    {
        $date_Range = new \Phunc\DateRange\DateRange();
        $date_Range->fillFromString($from, $to);
        $date_Range->getFrom()->hour(0)->minute(0)->second(0);
        $date_Range->getTo()->hour(24); //->minute(59)->second(59);
        return $date_Range->diffInDays();
    }
580615
public function between(\DateTime $start, \DateTime $end)
    {
        // Comparing DateTime also looks at the time. So we need to make sure the time is 0,
        // but don't modify the original referenced DateTime parameters
        $start = clone $start;
        $end = clone $end;
        $start->setTime(0, 0, 0);
        $end->setTime(0, 0, 0);

        $startyear = (int) $start->format("Y");
        $endyear   = (int) $end->format("Y");
        $holidays  = array();
        for ($y = $startyear; $y <= $endyear; $y++) {
            $holidays = array_merge($holidays, $this->getHolidays($y));
        }

        return array_filter($holidays,
            function(\DateTime $dt) use ($start, $end) {
                return $dt >= $start && $dt <= $end;
            });
    }
371166
public static Date add(Date date, int field, int amount) {
        CALENDAR.setTime(date);
        CALENDAR.add(field, amount);
        return CALENDAR.getTime();
    }
1193301
public function createCurrentMonthFromStartDate(\Carbon\Carbon $startDate)
    {
        $year = (int)$startDate->format('Y');
        $month = (int)$startDate->format('n');
        $day = (int)$startDate->format('d');

        $from = \Carbon\Carbon::create($year, $month, $day, 0, 0, 0, 'Europe/Berlin');

        $diffMonth = $from->month - $month;
        while ($diffMonth > 0) {
            $from = $from->copy()->subDay();
            $diffMonth = $from->month - $month;
        }
        return $from;
    }
1071847
public static function createFromStartEndDuration(CalendarDate $start, CalendarDate $end, Duration $duration)
    {
        return static::create($start, $end, $duration, null);
    }
122962
def _init_date_range(self, start_date=None, end_date=None):
        """"""
        self.end_date = end_date
        self.start_date = start_date
        if self.end_date is None:
            today = now_utc().date()
            end_date = self.event.end_dt.date()
            self.end_date = end_date if end_date < today else today
        if self.start_date is None:
            self.start_date = self.end_date - timedelta(days=ReportBase.default_report_interval)
43605
public static function inBetween( $startDate, $endDate, $date ) {

		$start 	= is_string( $startDate ) ? strtotime( $startDate ) : $startDate->getTimestamp();
		$end 	= is_string( $endDate ) ? strtotime( $endDate ) : $endDate->getTimestamp();
		$test 	= is_string( $date ) ? strtotime( $date ) : $date->getTimestamp();

		// Test in between start and end
		return ( ( $test >= $start ) && ( $test <= $end ) );
	}
234521
public function createdAt($start = null, $end = null)
    {
        /* @var $this ActiveQuery */
        $model = $this->noInitModel;
        if (!is_string($model->createdAtAttribute) || empty($model->createdAtAttribute)) {
            return $this;
        }
        return static::range($this, $model->createdAtAttribute, $start, $end);
    }