PHP | DatePeriod getStartDate() Function Last Updated : 30 Sep, 2019 Comments Improve Suggest changes Like Article Like Report The DatePeriod::getStartDate() function is an inbuilt function in PHP which is used to return the start date of the given date period. Syntax: DateTimeInterface DatePeriod::getStartDate( void ) Parameters: This function does not accept any parameters. Return Value: This function returns the start date of the given date period. Below programs illustrate the DatePeriod::getStartDate() function in PHP: Program 1: php <?php // Initialising a startDate with time $StartDate = new DateTime('2019-05-16T00:00:00Z'); // Initialising a DateInterval of 2 day $DateInterval = new DateInterval('P2D'); // Initialising a endDate with time $EndDate = new DateTime('2019-05-20T00:00:00Z'); // Initialising a DatePeriod with startDate, DateInterval and // endDate $datePeriod = new DatePeriod( $StartDate, $DateInterval, $EndDate); // Calling the getStartDate() function $StartDate = $datePeriod->getStartDate(); // Getting the start date echo $StartDate->format(DateTime::ISO8601); ?> Output: 2019-05-16T00:00:00+0000 Program 2: php <?php // Initialising a DatePeriod with a date of 2019-09-30, // time of 10 hours, 40 minutes and 44 seconds and with // day period of 14 days $datePeriod = new DatePeriod('R7/2019-09-30T10:40:44Z/P14D'); // Calling the getStartDate() function $StartDate = $datePeriod->getStartDate(); // Getting the start date echo $StartDate->format(DateTime::ISO8601); ?> Output: 2019-09-30T10:40:44+0000 Reference: https://www.php.net/manual/en/dateperiod.getstartdate.php Comment More infoAdvertise with us Next Article PHP | DatePeriod getStartDate() Function K Kanchan_Ray Follow Improve Article Tags : Web Technologies PHP PHP-date-time PHP-function Similar Reads PHP | DatePeriod getEndDate() Function The DatePeriod::getEndDate() function is an inbuilt function in PHP which is used to return the end date. If the given date period does not have any end date then it returns NULL.Syntax: DateTimeInterface DatePeriod::getEndDate( void ) Parameters: This function does not accept any parameters. Return 1 min read PHP | DatePeriod getDateInterval() Function The DatePeriod::getDateInterval() function is an inbuilt function in PHP which is used to return the date interval for the given date period. Syntax: DateInterval DatePeriod::getDateInterval( void ) Parameters: This function does not accept any parameters. Return Value: This function returns the Dat 1 min read PHP | date_get_last_errors() Function The date_get_last_errors() function is an inbuilt function in PHP which is used to returns the warnings and errors. This function parse a date/time string and returns an array of warnings and errors. Syntax: Procedural style: array date_get_last_errors( void ) Object oriented style: array DateTime:: 1 min read PHP | date_offset_get() Function The date_offset_get() function is an inbuilt function in PHP which is used to returns the timezone offset. This function returns the timezone offset in seconds from UTC (Universal Time Coordinated) on success or FALSE on failure. Syntax: Procedural Style: int date_offset_get( $object ) Object Orient 1 min read PHP | DateTimeZone::getName() Function The DateTimeZone::getName() function is an inbuilt function in PHP which is used to return the name of the created timezone. Syntax: DateTimeZone::getName() Parameters: This function does not accept any parameter. Return Values:: This function return the name of the created timezone. Below programs 1 min read PHP | getdate() Function The getdate() function is an inbuilt function in PHP which is used to get date/time information of the current local date/time. Syntax: getdate($timestamp) Parameters: The getdate() function accepts one parameter and it is described below: $timestamp: It is an optional parameter which specifies an i 2 min read PHP | date_isodate_set() Function The date_isodate_set() function is an inbuilt function in PHP which is used to sets the ISO (International Organization for Standardization ) date. This function set the date according to the ISO 8601 standard, using weeks and day offsets rather than specific dates. Syntax: Procedural style: date_is 2 min read PHP | date_parse() Function The date_parse() is an inbuilt function in PHP which is used to find the detailed information about a specified date. This function returns an associative array of detailed information for a specified date on success and returns FALSE on failure Syntax: date_parse($date) Parameters Used: The date_pa 2 min read PHP | IntlCalendar after() Function The IntlCalendar::after() function is an inbuilt function in PHP which returns True if the object time is after that of the passed object. Syntax: Object oriented style:bool IntlCalendar::after( IntlCalendar $other )Procedural style:bool intlcal_after( IntlCalendar $cal, IntlCalendar $other ) Parame 1 min read PHP | date_parse_from_format() Function The date_parse_from_format() is an inbuilt function in PHP which is used to get information about given date formatted according to the specified format. The date_parse_from_format() function accepts two parameters and returns associative array with detailed information about given date. Syntax: arr 3 min read Like