PHP 5 >= 5.2.0, PHP 7, PHP 8
date_parse - Returns associative array with detailed info about given date/time
Code Examples

date_parse( string$datetime ): array



Date/time in format accepted by DateTimeImmutable::__construct.

Return Values

Returns array with information about the parsed date/time on success or false on failure.

Exceptions and Errors

In case the date/time format has an error, the element 'errors' will contains the error messages.


Version Description
7.2.0 The zone element of the returned array represents seconds instead of minutes now, and its sign is inverted. For instance -120 is now 7200.

Related Functions

Example of date_parse

Show all examples for date_parse

PHP Version:

Function date_parse:

Date and Time Functions

Most used PHP functions