Question: how to change the default date format in php?
Answer: Change YYYY-MM-DD to MM-DD-YYYY Mysql default date format is Year-Month-Date that is why every PHP developer has with a problem. $date = "2019-02-08" ; $newDate1 = date ( "m-d-Y" , strtotime ( $date )); $newDate2 = date ( "l M, d, Y" , strtotime ( $date ));