I have found a solution. The correct date conversion syntax is:
$myDate = "01-12-1980"; $tempDate = date_create("$myDate"); $newDate = date_format($tempDate, 'j M Y'); echo "$newDate";
Outputs: December 1, 1980 (j removes the leading zero from the number of days instead of d)
Note:
$newDate = date("d MY", strtotime($myDate));
will not work in this example, because the expected input format is mm / dd / yyyy, using any other format will lead to incorrect output dates
source share