I receive a datetime from a plugin. I put it into a variable:
$datetime = \"20130409163705\";
That actually translates to yyyymm
You could do it like this:
<?php
$datetime = "20130409163705";
$format = "YmdHis";
$date = date_parse_from_format ($format, $datetime);
print_r ($date);
?>
You can look at date_parse_from_format() and the accepted format values.
https://en.functions-online.com/date.html?command={"format":"l jS \\of F Y h:i:s A"}