date format php timestamp code example
Example 1: php mysql timestamp format
date("Y-m-d H:i:s", strtotime($_POST['timestamp']));
Example 2: php timestamp format
date("d.m.Y", strtotime($mysqltimestamp)
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
Example 4: php date
$dateTime = new \DateTime();
/**
* You can get the string by using format
*/
$dateTime->format('Y-m-d H:i:s');