This method returns the end date for the current iteration of the
event.

@return DateTimeImmutable
424428
public function getDtEnd()
    {
        if (!$this->valid()) {
            return;
        }
        $end = clone $this->currentDate;

        return $end->modify('+'.$this->eventDuration.' seconds');
    }
1239283
public Date getEndDate()
    {
        if ((m_startTime != null) && (m_endTime != null))
        {
            if (m_endTime.before(m_startTime))
                return m_startTime;
        }
        return m_endTime;
    }
828876
public Date setEndDate(Date time)
    {
        try   {
            this.getTable().edit();
            this.getField("EndDateTime").setData(time);
            this.getTable().set(this);
            this.getTable().seek(null);    // Read this record
        } catch (Exception ex)  {
            ex.printStackTrace();
        }
        return this.getEndDate();
    }
1220784
def get_end_date(self):
        
        edate = self.my_osid_object._my_map['endDate']
        return DateTime(
            edate.year,
            edate.month,
            edate.day,
            edate.hour,
            edate.minute,
            edate.second,
            edate.microsecond)
922429
protected function dateTime(): DateTimeImmutable
    {
        if ($this->dateTime === null) {
            $year = $this->year();
            $month = $this->month();
            $day = $this->day();
            $hour = $this->hour();
            $minute = $this->minute();
            $second = $this->second();
            $timezone = $this->timezone()->toString();
            $this->dateTime = self::createNative($year, $month, $day, $hour, $minute, $second, $timezone);
        }

        return $this->dateTime;
    }
54825
public function endOfWeek()
        {
            if ($this->dayOfWeek != self::SUNDAY) $this->next(self::SUNDAY);

            return $this->endOfDay();
        }
435571
public function endOfMonth()
    {
        return $this->setDate($this->year, $this->month, $this->daysInMonth)->endOfDay();
    }
807778
public function getLast()
    {
        $last = null;

        if (count($this->objects) > 0) {
            $last = end($this->objects);
        }

        return $last;
    }
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;
    }
1002935
public function endDatetime()
    {
        $date = explode('-', $this->end_date);
        $time = explode(':', $this->end_time);
        $end_datetime = Carbon::create($date[0], $date[1], $date[2], $time[0], $time[1]);

        return $end_datetime;
    }
428594
public function get_end() {
        if (!empty($this->end)) {
            return $this->end;
        }

        $this->end = time();
        return $this->end;
    }
154999
public function endOfMonth() {
        
        $lastDay = static::getMonthLength($this->month, $this->year);
        
        return $this->day($lastDay)->endOfDay();
    }
1307907
public function getFinishTime() {
        if (!isset($this->finishTime)) {
            try {
                $this->finishTime = (string)$this->getData(OntologyDeliveryExecution::PROPERTY_TIME_END);
            } catch (common_exception_NotFound $missingException) {
                $this->finishTime = null;
            }
        }
        return $this->finishTime;
    }
1080684
public function endOfDecade()
    {
        return $this->endOfYear()->year(
            $this->getYear() - $this->getYear() % static::YEARS_PER_DECADE + static::YEARS_PER_DECADE - 1
        );
    }
662798
public function getRangeString()
    {
        $dateStart = $this->getDateStart();
        $dateEnd   = $this->getDateEnd();

        return $dateStart->toString("Y-m-d") . "," . $dateEnd->toString("Y-m-d");
    }
1164331
public function next()
    {
        $this->currentOverriddenEvent = null;
        ++$this->counter;
        if ($this->nextDate) {
            // We had a stored value.
            $nextDate = $this->nextDate;
            $this->nextDate = null;
        } else {
            // We need to ask rruleparser for the next date.
            // We need to do this until we find a date that's not in the
            // exception list.
            do {
                if (!$this->recurIterator->valid()) {
                    $nextDate = null;
                    break;
                }
                $nextDate = $this->recurIterator->current();
                $this->recurIterator->next();
            } while (isset($this->exceptions[$nextDate->getTimeStamp()]));
        }

        // $nextDate now contains what rrule thinks is the next one, but an
        // overridden event may cut ahead.
        if ($this->overriddenEventsIndex) {
            $offsets = end($this->overriddenEventsIndex);
            $timestamp = key($this->overriddenEventsIndex);
            $offset = end($offsets);
            if (!$nextDate || $timestamp < $nextDate->getTimeStamp()) {
                // Overridden event comes first.
                $this->currentOverriddenEvent = $this->overriddenEvents[$offset];

                // Putting the rrule next date aside.
                $this->nextDate = $nextDate;
                $this->currentDate = $this->currentOverriddenEvent->DTSTART->getDateTime($this->timeZone);

                // Ensuring that this item will only be used once.
                array_pop($this->overriddenEventsIndex[$timestamp]);
                if (!$this->overriddenEventsIndex[$timestamp]) {
                    array_pop($this->overriddenEventsIndex);
                }

                // Exit point!
                return;
            }
        }

        $this->currentDate = $nextDate;
    }
57732
public function getExpiration()
    {
        $dateTime = new DateTime();

        return $dateTime
            ->setDate($this->year, $this->month, $this->getMonthDays())
            ->setTime(23, 59, 59);
    }