<?php
$date = "26 August 2022 22:30 pm";
$parsed = date_parse_from_format("j F Y G:i a", $date);
echo "Warnings count: ", $parsed['warning_count'], "\n";
foreach ($parsed['warnings'] as $position => $message) {
echo "\tOn position {$position}: {$message}\n";
}
The above example will output:
Warnings count: 1
On position 23: The parsed time was invalid