PHP 5 >= 5.6.5, PHP 7, PHP 8
DatePeriod::getEndDate - Gets the end date
Code Examples

DatePeriod::getEndDate( ): public DateTimeInterface|null

Gets the end date of the period.


This function has no parameters.

Return Values

Returns null if the DatePeriod does not have an end date. For example, when initialized with the recurrences parameter, or the isostr parameter without an end date.

Returns a DateTimeImmutable object when the DatePeriod is initialized with a DateTimeImmutable object as the end parameter.

Returns a DateTime object otherwise.

Example of DatePeriod::getEndDate

Show all examples for DatePeriod::getEndDate

PHP Version:

Function DatePeriod::getEndDate:

Date and Time Functions

Most used PHP functions