Please find the following scenario, I\'ve dynamic JS date format string from API but I am looking for the best way to convert the format that except in PHP. For now, I wrote