The date_parse() function parses string to get a date.
PHP date_parse() Function has the following syntax.
date_parse(date);
date - Required. Date in a format accepted by strtotime()
PHP date_parse() Function returns parsed date on success. FALSE on failure.
Parse a string to date
<?php
print_r(date_parse("2013-05-01 12:30:45.5"));
echo "\n";
$time = "00:14:38";
$parse_date = date_parse($time);
echo var_dump($parse_date) ."\n";
?>
The code above generates the following result.