Get number of minutes in a hour, incrementing by a step.

$minutes = Date::minutes();

@param  int $step  Amount to increment each step by, 1 to 30
@param  int $start Start value
@param  int $end   End value
@return array
431135
public static function minutes(int $step = 5, int $start = 0, int $end = 60) : array
    {
        return Date::_range($step, $start, $end);
    }
1009086
public static function diffDays($start, $end) {
        if (!is_string($start))                      throw new IllegalTypeException('Illegal type of parameter $start: '.gettype($start));
        if (Validator::isDateTime($start) === false) throw new InvalidArgumentException('Invalid argument $start: "'.$start.'"');
        if (!is_string($end))                        throw new IllegalTypeException('Illegal type of parameter $end: '.gettype($end));
        if (Validator::isDateTime($end) === false)   throw new InvalidArgumentException('Invalid argument $end: "'.$end.'"');

        $ts1 = strtotime($start.' GMT'); // ohne Angabe einer Zeitzone wird die lokale DST einkalkuliert
        $ts2 = strtotime($end.' GMT');

        $diff = $ts2 - $ts1;

        if ($diff % DAYS)
            Logger::log('('.$ts2.'-'.$ts1.') % DAYS != 0: '.($diff%DAYS), L_WARN);

        return (int)($diff / DAYS);
    }
113139
protected function get_time_range_weeks_number($starttime, $endtime) {
        if ($endtime <= $starttime) {
            throw new \coding_exception('End time timestamp should be greater than start time.');
        }

        $starttimedt = new \DateTime();
        $starttimedt->setTimestamp($starttime);
        $starttimedt->setTimezone(new \DateTimeZone('UTC'));
        $endtimedt = new \DateTime();
        $endtimedt->setTimestamp($endtime);
        $endtimedt->setTimezone(new \DateTimeZone('UTC'));

        $diff = $endtimedt->getTimestamp() - $starttimedt->getTimestamp();
        return $diff / WEEKSECS;
    }
730216
public static function range(int $base, int $stop = null, int $step = 1): Arrayy
    {
        if ($stop !== null) {
            $start = $base;
        } else {
            $start = 1;
            $stop = $base;
        }

        return Arrayy::create(\range($start, $stop, $step));
    }
712848
public function lgetrange($key, $start, $end)
    {
        try {
            return $this->redis->lgetrange($key, $start, $end);
        } catch (\RedisException $e) {
            die("Error!: " . $e->getMessage() . "<br/>");
        }
    }
1140481
public function setLocation(Coordinate $start, Coordinate $end)
    {
        return $this->setStart($start)->setEnd($end);
    }
231445
public function usage($start = false, $end = false, $period = null)
    {
        $params = array();

        if ($start) {
            $params['start'] = $start;
        }
        if ($end) {
            $params['end'] = $end;
        }
        if (isset($period)) {
            $params['period'] = $period;
        }

        return $this->_user->get('account/usage', $params);
    }
474052
private function getReferersCountFromSessionActivities($start, $end)
    {
        return $this->getVisitsFilteredByDateRange($start, $end)
            ->transform(function (VisitorActivity $visit) {
                return [
                    'name' => $visit->hasReferer()
                        ? $visit->referer->domain->name
                        : trans('tracker::generals.undefined'),
                ];
            })
            ->groupBy('name')
            ->transform(function (Collection $items, $key) {
                return [
                    'name'  => $key,
                    'count' => $items->count(),
                ];
            })
            ->sortByDesc('count');
    }
195902
private function getInvoices(DateTime $startDate, DateTime $endDate)
    {
        $offset = Mirakl::MIRAKL_API_MAX_PAGINATE;

        $invoicesData = $this->mirakl->getInvoices(
            $startDate,
            $endDate
        );

        $invoices = array_merge(array(), $invoicesData['invoices']);

        $total = $invoicesData['total_count'];

        while ($total % $offset !== $total) {

            $invoicesData = $this->mirakl->getInvoices(
                $startDate,
                $endDate,
                Mirakl::MIRAKL_API_MAX_PAGINATE,
                $offset
            );

            $invoices = array_merge($invoices, $invoicesData['invoices']);

            $offset += Mirakl::MIRAKL_API_MAX_PAGINATE;
        }

        return $invoices;
    }
601437
public function getBetween($content, $start, $end = null)
    {
        return $this->api->getBetween($content, $start, $end);
    }
754396
public function getProductStats(Product $product, $start, $end)
    {
         /** @var CheckoutManager $checkoutManager */
        $adminManager =  $this->container->get('checkout_manager');
        $stats = $adminManager->getProductStats($product, $start, $end);

        
        return  $stats;
    }
663405
final public static function formatDateDiff($start, $end = null, $parts = 0)
    {
        if (!($start instanceof \DateTimeInterface)) {
            $start = self::asDateTime($start);
        }

        if ($end === null) {
            $end = self::now();
        } else {
            if (!($end instanceof \DateTimeInterface)) {
                $end = self::asDateTime($end);
            }
        }

        $interval = $end->diff($start);

        return self::formatInterval($interval, $parts);
    }
182228
public static function getDuration($start)
    {
        $time = microtime();
        $time = explode(' ', $time);
        $time = $time[1] + $time[0];
        $finish = $time;
        
        return round(($finish - $start), 4);
    }
444816
public function slice ($start, $end)
	{
		if (!is_numeric($start)) {
			$start = var_export($start, true);

			throw new \OutOfBoundsException("Invalid start index {$start}");
		}

		if (!is_numeric($end)) {
			$end = var_export($end, true);

			throw new \OutOfBoundsException("Invalid end index {$end}");
		}

		return V(array_slice($this->storage, $start, ($end - $start)));
	}
574583
public function getLeads($startDate, $endDate, array $params = array())
    {
        $isValidStartDate = $this->utils->isSystemDatetime($startDate);
        $isValidEndDate = $this->utils->isSystemDatetime($endDate);
        if (!$isValidEndDate || !$isValidStartDate) {
            throw new InvalidArgumentException('Invalid params: Only system date has available YYYY-MM-DDD HH:II:SS');
        }

        if ($startDate > $endDate) {
            throw new InvalidArgumentException('Invalid params: start_date > end_date');
        }

        $isOutOfLimit = $this->utils->isOutOfLimit($startDate, $endDate, LeadAcademic::LIMIT_PERIOD);
        if ($isOutOfLimit) {
            throw new InvalidArgumentException('Invalid params: Period is too large. Available only ' . LeadAcademic::LIMIT_PERIOD);
        }

        $params['date_lbound'] = $startDate;
        $params['date_ubound'] = $endDate;

        $this->normalizeParams($params);
        $response = $this->execute('/', $params);
        $data = $this->normalize($response);
        return $data['leads'];
    }
371676
protected function buildRangeObject($start, $end)
    {
        return new TimeRange(
                TimeOfDay::fromNative($start),
                TimeOfDay::fromNative($end)
        );
    }
613675
public function getrange($key, $start, $end) {
        return $this->returnCommand(['GETRANGE'], $key, [$key, $start, $end]);
    }