php date_format
snippet in php

php datetime format

user2689

PHP date_format() Function

Example
Return a new DateTime object, and then format the date:

<?php

 $date=date_create("2020-03-09");
echo date_format($date,"Y/m/d H:i:s");
?>
 

php date_format

user4186


<?php

 $date=date_create("2013-03-15");
echo date_format($date,"Y/m/d H:i:s");
?>
 

date time format php

user4011

$today = date("F j, Y, g:i a");                 // March 10, 2001, 5:16 pm