convert date time to PHP format code example
Example 1: convert date in php
$originalDate = "2010-03-21";
$newDate = date("d-m-Y", strtotime($originalDate));
Example 2: Convert String to Date and Date-Time in PHP
phpCopyecho $dateNew = DateTime::createFromFormat('m-d-Y', '03-08-2020')->format('Y/m/d');
//output: 2020/03/08