date_format

It Returns date formatted according to given format and is an alias of DateTime::format()

Example

<?php
$date = date_create(‘2007-05-17’);
echo date_format($date, ‘Y-m-d H:i:s’);
?>

Output

2007-05-17 00:00:00

Share