Sets the start date of the event

@param   DateTime    $start
@return  $this
@throws  \Solution10\Calendar\Exception\Event
439983
public function setStart(DateTime $start)
    {
        if ($this->end && $start > $this->end) {
            throw new EventException(
                'New start comes after the end!',
                EventException::INVALID_DATES
            );
        }
        $this->start = clone $start;
        return $this;
    }
218407
public function setTimeRange(DateTimeInterface $start = null, DateTimeInterface $end = null)
    {
        if (!$start) {
            $start = new DateTimeImmutable(Settings::$minDate);
        }
        if (!$end) {
            $end = new DateTimeImmutable(Settings::$maxDate);
        }
        $this->start = $start;
        $this->end = $end;
    }
1058777
public function setDatePublishStart($datePublishStart = null)
    {
        if (!isset($datePublishStart) || is_string($datePublishStart)) {
            $datePublishStart = new \DateTime($datePublishStart);
        } elseif (!$datePublishStart instanceof \DateTime) {
            throw new \InvalidArgumentException('Expected object of type \DateTime');
        }

        $this->datePublishStart = $datePublishStart;
        return $this;
    }
458188
public function setStartTime($startTime)
    {
        if ($startTime instanceof \DateTime)
        {
            $startTime = $startTime->format('H:i');
        }

        // deal with "hour-only" input
        if (2 == strlen($startTime))
        {
            $startTime .= ':00';
        }

        $this->start_time = $startTime;

        // Let's go ahead and set the default end_time
        $end_time = $this->getEndTimeFromStartTime($this->getStartTimeObject())
            ->format('H:i')
        ;
        $this->setEndTime($end_time);
    }
1172828
public function setStartElement(MenuElement $startElement = null)
    {
        $this->startElement = $startElement;
        if ($startElement && !in_array($startElement, $this->elements, true)) {
            array_push($this->elements, $startElement);
        }
        return $this;
    }
993129
public function startup(Event $event)
    {
        $controller = $event->subject();
        if (!empty($controller->request->data) && !Configure::read('DataPreparation.notrimRequestData')) {
            $controller->request->data = $this->_trimDeep($controller->request->data);
        }
        if (!empty($controller->request->query) && !Configure::read('DataPreparation.notrimRequestQuery')) {
            $controller->request->query = $this->_trimDeep($controller->request->query);
        }
        if (!empty($controller->request->params['pass']) && !Configure::read('DataPreparation.notrimRequestParams')) {
            $controller->request->params['pass'] = $this->_trimDeep($controller->request->params['pass']);
        }
    }
612428
public function setDateFromDateTime(DateTime $date = NULL, DateTimeZone $dateTimeZone = NULL) {
    $dateTimeZone = !empty($dateTimeZone) ? $dateTimeZone : new DateTimeZone('UTC');
    $this->date = !empty($date) ? $date : new DateTime($date);
    $this->date->setTimezone($dateTimeZone);
  }
1300066
public function setDate(\DateTimeInterface $date): self
    {
        if ($date instanceof \DateTime) {
            $date = \DateTimeImmutable::createFromMutable($date);
        }
        $date = $date->setTimezone(new \DateTimeZone('UTC'));
        $this->headers->set('Date', $date->format('D, d M Y H:i:s') . ' GMT');

        return $this;
    }
1329001
public function setCreationTime(\DateTime $time = null)
	{
		if (is_null($time)) {
			$time = new \DateTime('now');
		}
		$this->creationTime = $time;
	}
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;
            });
    }
424675
public function setDate(DateTimeInterface $dateTime)
    {
        if (!$this->setHeaderFieldModel('Date', $dateTime)) {
            $this->getHeaders()->addDateHeader('Date', $dateTime);
        }

        return $this;
    }
514512
function setStartDate($date)
    {
        if (!is_object($date) || !is_a($date, 'DateTime')) {
            $date = new DateTime($date, new DateTimeZone(@date_default_timezone_get()));
        }

        $this->startDate = $date->format('D, d M Y H:i:s O');
    }
134074
public function setStartDate(Carbon $startDate)
    {
        $this->validatePeriod($startDate, null);

        $this->startDate = $startDate;

        return $this;
    }
480552
public function getStart(): ?\DateTimeInterface
    {
        $lowest_date = null;
        foreach ($this->events as $event) {
            if (null === $lowest_date || $event->getStart() < $lowest_date) {
                $lowest_date = $event->getStart();
            }
        }

        return $lowest_date;
    }
1058484
public function setTime(DateTime $time = null)
    {
        $timestamp = $time ? $time->getTimestamp() : null;

        $this->session->put($this->timePersistenceKey, $timestamp);

        if ($time) {
            $this->setState(static::HISTORY);
        }

        return $this;
    }
1003417
protected function _dateDiff($start = null, $stop = null) {
		if ($start) {
			$endDate = $stop instanceof DateTime ? $stop : new DateTime($stop ? $stop : 'now');
			$startDate = $start instanceof DateTime ? $start : new DateTime($start);
			$diff = $startDate->diff($endDate)->format(Configure::read('Task.dateDiffFormat'));
			return $this->_isCli ? $diff : $this->Html->tag('span', $diff);
		} else {
			return $this->_none();
		}
	}
1200726
protected function buildRangeObject($start, $end)
    {
        return new DateRange(
            Date::fromNative($start),
            Date::fromNative($end)
        );
    }