Answers for "how to show date format mm dd yyyy in php"

PHP
7

php change date format

To convert the date-time format PHP provides strtotime() and date() function. We change the date format from one format to another.

Change YYYY-MM-DD to DD-MM-YYYY
<? php.
$currDate = "2020-04-18";
$changeDate = date("d-m-Y", strtotime($currDate));
echo "Changed date format is: ". $changeDate. " (MM-DD-YYYY)";
?>
Posted by: Guest on April-18-2020
3

php date format dd/mm/yyyy

date("d/m/Y", strtotime($str));
Posted by: Guest on November-01-2020

Code answers related to "how to show date format mm dd yyyy in php"

Browse Popular Code Answers by Language