@param null|Carbon $date

@return $this
344402
public function publishAt(Carbon $date = null)
    {
        $this->publishedAt = (null === $date ? Carbon::now() : $date);

        return $this;
    }
1039701
protected function parse_date($date) {
        if($date instanceof \Carbon\Carbon) return $date;

        try {
            $date = Carbon::parse($date);
        } catch (\Exception $e) {
            throw new MessageSearchValidationException();
        }

        return $date;
    }
512057
public function setDate(string $date = null): Matomo
    {
        $this->_date = $date;
        $this->_rangeStart = null;
        $this->_rangeEnd = null;

        return $this;
    }
883212
public function on($date)
    {
        $parsedDate = \date_parse($date);
        $segments = \array_intersect_key($parsedDate, $this->fieldsPosition);

        if ($parsedDate['year']) {
            $this->skip(static function () use ($parsedDate) {
                return (int) \date('Y') !== $parsedDate['year'];
            });
        }

        foreach ($segments as $key => $value) {
            if (false !== $value) {
                $this->spliceIntoPosition($this->fieldsPosition[$key], (string) $value);
            }
        }

        return $this;
    }
432151
public function setDate($date)
    {
        $this->add(self::PERIOD, $date->getPeriod());
        $this->add(self::DATE, $date->getDate());

        return $this;
    }
1338813
private static function cast(Date $date = null)
	{
		if (!is_null($date))
		{
			$date = new DateTime($date);
		}

		return $date;
	}
129210
protected function getYearAndDayHash(Carbon $date)
    {
        return str_pad(base_convert($date->diffInDays($this->startBaseDate), 10, 36), 3, '0', STR_PAD_LEFT);
    }
516845
public function dontSeeDateIsMonday($date) {
        \PHPUnit_Framework_Assert::assertFalse($this->_ParseDate($date)->dayOfWeek == Carbon::MONDAY);
    }
762464
public function calendar($date = null)
    {
        if (is_null($date)) {
            $date = date('Y-m-d');
        }

        $events = $this->service->calendar($date);
        $calendar = $this->service->generate($date);

        if (empty($calendar)) {
            abort(404);
        }

        return view('cms-frontend::events.calendar')
            ->with('events', $events)
            ->with('calendar', $calendar);
    }
1083260
@SuppressWarnings("unchecked")
    public T date( Date... date ) {
        if (checkIfNull(date)) {
            return (T) this;
        }
        date = ensureDateNotTimestamp(date);
        addObjectParameter(DATE_LIST, "date", date);
        return (T) this;
    }
747977
public function setBirthdateAttribute(Carbon $birthdate = null)
    {
        if ($birthdate === null) {
            return $this->attributes['birthdate'] = null;
        }

        return $this->attributes['birthdate'] = $birthdate;
    }
573870
public function findByDate(\DateTime $date = null)
    {
        $date = $date ?: new \DateTime();

        return $this->repository->findByDate($date);
    }
457780
public function setDateTimeFrom($date = null)
    {
        $date = $this->resolveCarbon($date);

        return $this->modify($date->rawFormat('Y-m-d H:i:s.u'));
    }
1183644
public function average($date = null)
    {
        return $this->addSeconds((int) ($this->diffInSeconds($this->resolveCarbon($date), false) / 2));
    }
1181067
public function date($date)
    {
        $events = $this->repository->findEventsByDate($date);

        if (empty($events)) {
            abort(404);
        }

        return view('cms-frontend::events.date')->with('events', $events);
    }
841371
public function getDate()
    {
        if (!isset($this->data['date'])) {
            return null;
        }
        try {
        return (class_exists('\Carbon\Carbon')) ?
            new \Carbon\Carbon($this->data['date'], 'GMT') :
            $this->data['date'];
        } catch (\Exception $e) {
            return null;
        }
    }
548818
protected static function toHijri(Carbon $date, int $adjustment = 0)
    {
        $adjusted = (new Carbon($date))->addDays($adjustment);

        $jd = Converter::gregorianToJulian($adjusted->year, $adjusted->month, $adjusted->day);
        $hijri = Converter::julianToHijri($jd);

        return new Date($hijri->day, $hijri->month, $hijri->year, $jd, clone $date, $adjustment);
    }