PHP DateTime get Date code example
Example 1: extract date from DateTime object php
<?php
$date = new DateTime('2000-01-01');
echo $date->format('Y-m-d H:i:s');
?>
Example 2: php get date
date("Y-m-d h:i:sa")
Example 3: php timestamp format
date("d.m.Y", strtotime($mysqltimestamp)
Example 4: date time format php
$today = date("F j, Y, g:i a"); // March 10, 2001, 5:16 pm