The Date_parse () function returns an associative array that contains details for the specified day. If successful, returns an associative array containing the resolved date information, or FALSE if it fails. The parameters that can be resolved are the same as those supported by Strtotime ().
Definitions and usage
The Date_parse () function returns an associative array that contains details for the specified day.
Grammar
Date_parse (date);
Parameter description
Date Required. The specified date (format is accepted by Strtotime ()).
Technical details
Return value: Returns an associative array containing the resolved date information if successful and FALSE if it fails.
PHP version: 5.2+
<?php
Print_r (Date_parse ("2016/1/11 10:05:50"));
?>
Output:
Array
(
[Year] => 2016
[Month] => 1
[Day] => 11
[Hour] => 10
[Minute] => 5
[Second] => 50
[Fraction] => 0
[Warning_count] => 0
[Warnings] => Array
(
)
[Error_count] => 0
[Errors] => Array
(
)
[Is_localtime] =>
)