I want to convert the string date to following format 'Y-m-d' from multiple date format like for example
12-3-17, 12-3-2017, 12.3.17, 12.3.2017, 12.03.17, 12/3/17
$ymd = DateTime::createFromFormat('m-d-Y', '10-16-2003')->format('Y-m-d');
The closest solution that i got so far is from the following article read the article here
is there a better solution, considering the fact that the input date string may be in unknown format ?