date_parse()
arisdelaCruz141361885717 total contributions
Published Jul 18, 2023
Contribute to Docs
The date_parse()
is an built-in function in PHP which is used to find the detailed information about a specified date.
Syntax
date_parse($date);
The $date
parameter is mandatory. The date_parse()
function returns an associative array of detailed information for a specified date on success, and returns false
on failure.
Example
The example below gets an array from the date_parse()
function, and prints out various elements from it:
<?phpprint_r(date_parse("2023-06-27 11:27:40"));?>
The output will be as follows:
Array([year] => 2023[month] => 6[day] => 27[hour] => 11[minute] => 27[second] => 40[fraction] => 0[warning_count] => 0[warnings] => Array()[error_count] => 0[errors] => Array()[is_localtime] =>)
All contributors
- arisdelaCruz141361885717 total contributions
Looking to contribute?
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.