convert date time to time with t in php code example
Example 1: Convert String to Date and Date-Time in PHP
phpCopy$oldDate = strtotime('03/08/2020');
$newDate = date('Y-m-d',$time);
echo $newDate;
//output: 2020-03-08
Example 2: Convert String to Date and Date-Time in PHP
phpCopyecho $dateNew = date_create_from_format("m-d-Y", "03-08-2020")->format("Y-m-d");
//output: 2020/03/08