get date from datetime php code example
Example 1: php extract time from datetime
$time = '2013-01-22 10:45:45';
echo $time = date("H:i:s",strtotime($time));
Example 2: php get date
date("Y-m-d h:i:sa")
Example 3: date to string php
$date_string_prepared = date_create("2020-08-07");
$date_string = $date_string_prepared->format("d M Y");
// result 07 Jul 2020