PHP | date_get_last_errors() Function Last Updated : 14 Sep, 2018 Comments Improve Suggest changes Like Article Like Report 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::getLastErrors( void ) Parameters: This function does not accept any parameter. Return Value: This function returns an array containing information about warnings and errors. Below programs illustrate the date_get_last_errors() function in PHP: Program 1: php <?php $date = date_create(); print_r(date_get_last_errors()); ?> Output: Array ( [warning_count] => 0 [warnings] => Array ( ) [error_count] => 0 [errors] => Array ( ) ) Program 2: php <?php try { $date = new DateTime('vgdgh'); } catch (Exception $e) { // For demonstration purposes only... print_r(DateTime::getLastErrors()); } ?> Output: Array ( [warning_count] => 0 [warnings] => Array ( ) [error_count] => 1 [errors] => Array ( [0] => The timezone could not be found in the database ) ) Related Articles: PHP | gmstrftime() Function PHP | gettimeofday() Function PHP | strptime() Function Reference: http://php.net/manual/en/datetime.getlasterrors.php Comment More infoAdvertise with us Next Article PHP | date_get_last_errors() Function V vijay_raj Follow Improve Article Tags : Misc Web Technologies PHP PHP-date-time PHP-function +1 More Practice Tags : Misc Similar Reads PHP error_get_last() Function The error_get_last() function is an inbuilt PHP function in PHP which is used to get the last error that occurred. Syntax: error_get_last(): ?arrayParameter: This function does not accept any parameters. Return Value: It returns an associate array that explains the last error with keys "type", "mess 1 min read PHP error_clear_last() Function The error_clear_last() function is an inbuilt function in PHP that is utilized to remove the most recent error. Syntax: error_clear_last(): void Parameter: This function does not accept any parameters. Return Value: The most recent error will be cleared & making it impossible to retrieve that er 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 | 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 array_âkey_âlast() Function The array_âkey_âlast() function is an inbuilt function in PHP that is used to get the last key of an array. This function returns the last key without affecting the internal array pointer. Syntax: int|string|null array_âkey_âlast(array $array) Parameters: This function accepts single parameter $arra 1 min read Like