I have a ridiculous string provided by data that isn't adjustable and I need to convert it to a timestamp in a consistent manner.
5162016
sometimes 2 digit month, sometimes leading zeros sometimes not.
I tried using DateTime
$time = \DateTime::createFromFormat("njY", "5162016");
$timestamp = $time->getTimestamp();
I tried both njY and mdY but both return a timestamp that converts to 05/01/0020
Any ideas would be appreciated.