PHP DateTime::format() April 18, 2012 Pramod T P It Returns date formatted according to given format Example <?php $date = new DateTime(‘2007-05-17’); echo $date->format(‘Y-m-d H:i:s’); ?> Output 2007-05-17 00:00:00