Recompute the start date and time of the track.

@return \DateTimeImmutable
505567
private function recomputeStartDateTime(): \DateTimeImmutable
    {
        $this->startDateTime = null;
        foreach ($this->trackPoints() as $trackPoint) {
            if ($this->startDateTime === null || $this->startDateTime > $trackPoint->dateTime()) {
                $this->startDateTime = clone $trackPoint->dateTime();
            }
        }

        return $this->startDateTime;
    }
774184
final public function getDate(): ?\DateTimeImmutable
    {
        /** @var null|string $dateHeader */
        $dateHeader = $this->getHeaders()->get('date');
        if (null === $dateHeader) {
            return null;
        }

        $alteredValue = $dateHeader;
        $alteredValue = \str_replace(',', '', $alteredValue);
        $alteredValue = (string) \preg_replace('/^[a-zA-Z]+ ?/', '', $alteredValue);
        $alteredValue = (string) \preg_replace('/ +\(.*\)/', '', $alteredValue);
        $alteredValue = (string) \preg_replace('/\bUT\b/', 'UTC', $alteredValue);
        if (0 === \preg_match('/\d\d:\d\d:\d\d.* [\+\-]\d\d:?\d\d/', $alteredValue)) {
            $alteredValue .= ' +0000';
        }

        try {
            $date = new \DateTimeImmutable($alteredValue);
        } catch (\Throwable $ex) {
            throw new InvalidDateHeaderException(\sprintf('Invalid Date header found: "%s"', $dateHeader), 0, $ex);
        }

        return $date;
    }
214660
public function getExecutionTime()
    {
        if(!$this->getFinishedAt()) {
            $now = new \DateTime();
            return $now->getTimestamp() - $this->getCreatedAt()->getTimestamp();
        } else {
            return $this->getFinishedAt()->getTimestamp() - $this->getCreatedAt()->getTimestamp();
        }
    }
1212873
public function withDateAtStartOfYear() : self
    {
        $instance = $this->withTimeAtMidnight();
        
        $instance->date->setDate($instance->format('Y'), 1, 1);
        
        return $instance;
    }
1097981
public function setStartTime(string $value) : Migration
    {

        if ($this->data['start_time'] !== $value) {
            $this->data['start_time'] = $value;
            $this->setModified('start_time');
        }

        return $this;
    }
419276
public function updatedAtDatetime()
    {
        return $this->entity->updated_at->setTimezone($this->config->get('config.timezone'))
                                        ->format($this->config->get('config.date_format') . ' ' . $this->config->get('config.time_format'));
    }
687225
public function updatedAtToday()
    {
        /* @var $this ActiveQuery */
        $model = $this->noInitModel;
        $start = strtotime(date('Y-m-d'));
        $end = $start + 86400;
        if ($model->timeFormat == BaseEntityModel::$timeFormatDatetime) {
            $start = gmdate('Y-m-d H:i:s', $start);
            $end = gmdate('Y-m-d H:i:s', $end);
        }
        return $this->updatedAt($start, $end);
    }
53300
public function getLastChanged(): \DateTime
    {
        \clearstatcache();
        if (false === $ctime = \filectime($this->filename)) {
            throw new TimeCanNotBeReadException('Time of last change can not be read.');
        }
        return (new \DateTime())->setTimestamp($ctime);
    }
136341
public function lastEarnedDate() : \DateTime
    {
        return new \DateTime(
            $this->comparing() ?
            $this->group->comparedUser->lastUpdateDate :
            $this->group->fromUser->lastUpdateDate
        );
    }
909314
private function getTimezonesHavingNewDaySinceLastRun()
    {
        $timestamp = $this->lastSuccessRunTimestamp;
        $uniqueTimezones = APISitesManager::getInstance()->getUniqueSiteTimezones();
        $timezoneToProcess = array();
        foreach ($uniqueTimezones as &$timezone) {
            $processedDateInTz = Date::factory((int)$timestamp, $timezone);
            $currentDateInTz = Date::factory('now', $timezone);

            if ($processedDateInTz->toString() != $currentDateInTz->toString()) {
                $timezoneToProcess[] = $timezone;
            }
        }
        return $timezoneToProcess;
    }
581993
public function getModificationTime() {

		if(false !== $this -> file -> getExists()) {

			$this -> refresh();
			
			return $this -> file -> getModificationTime();
		}
	}
411745
public function rewind()
    {
        $this->recurIterator->rewind();
        // re-creating overridden event index.
        $index = [];
        foreach ($this->overriddenEvents as $key => $event) {
            $stamp = $event->DTSTART->getDateTime($this->timeZone)->getTimeStamp();
            $index[$stamp][] = $key;
        }
        krsort($index);
        $this->counter = 0;
        $this->overriddenEventsIndex = $index;
        $this->currentOverriddenEvent = null;

        $this->nextDate = null;
        $this->currentDate = clone $this->startDate;

        $this->next();
    }
1371291
public function getUpdated(): \Lullabot\Mpx\DataService\DateTime\DateTimeFormatInterface
    {
        if (!$this->updated) {
            return new NullDateTime();
        }

        return $this->updated;
    }
483713
public function getCurrentRound()
    {
        $isStop = false;
        $today  = new \Zend_Date();
        $tokens = $this->getTokens();
        $stop   = $this->util->getReceptionCodeLibrary()->getStopString();

        foreach ($tokens as $token) {
            $validUntil = $token->getValidUntil();

            if (! empty($validUntil) && $validUntil->isEarlier($today)) {
                continue;
            }

            if ($token->isCompleted()) {
                continue;
            }

            $code = $token->getReceptionCode();
            if (! $code->isSuccess()) {
                if ($code->getCode() === $stop) {
                    $isStop = true;
                }
                continue;
            }

            return $token->getRoundDescription();
        }
        if ($isStop) {
            return $this->translate->_('Track stopped');
        }

        return $this->translate->_('Track completed');
    }
840893
protected function recalculate()
    {
        $adjusted = (new Carbon($this->date))->addDays($this->adjustment);

        $julian = Converter::gregorianToJulian($adjusted->year, $adjusted->month, $adjusted->day);

        $hijri = Converter::julianToHijri($julian);

        $this->julianDay = $julian;
        $this->day = $hijri->day;
        $this->month = $hijri->month;
        $this->day = $hijri->day;

        return $this->fillValuesArray();
    }
435815
public function getStarted()
    {
        $rtn    = $this->data['started'];

        if (!empty($rtn)) {
            $rtn    = new \DateTime($rtn);
        }
        
        return $rtn;
    }
898135
public function getStartDate() {
        $now = $this->getNow();
        $endOfDay = $this->getToday()->modify('+18 hours');

        $currentDay = $this->getToday();

        if($now > $endOfDay) {
            $currentDay->modify('+1 day');
        }

        return $currentDay;
    }