$date = "10 October 2018 19:30 pm";
print_r (date_parse_from_format("j F Y G:i a", $date));
Output:
Array (
[year] => 2018
[month] => 10
[day] => 10
[hour] => 31
[minute] => 30
[second] => 0
[fraction] =>
[warning_count] => 1
[warnings] => Array (
[24] => The parsed time was invalid
)
[error_count] => 0
[errors] => Array ( )
[is_localtime] =>
)
19:30 pm is invalid, 24-hour format of an hour can't be used with am/pm
must be replaced with:
$date = "10 October 2018 19:30";
print_r (date_parse_from_format("j F Y G:i", $date));
or:
$date = "10 October 2018 7:30 pm";
print_r (date_parse_from_format("j F Y g:i a", $date));