I have a PHP variable '$date', and it's value is: y/m/d h:i:s
format.
e.g: $date = "2014-11-10 17:25:00";
I want to change this format to m/d/y h:i:s
format, so that I'm using PHP code below. It's working fine but is there any PHP function to do it in one line of code ?
$date = "2014-11-10 17:25:00";
$explode = explode(" ", $date);
$part1 = $explode[0];
$part2 = $explode[1];
$explode = explode("-", $part1);
$year = $explode[0];
$month = $explode[1];
$day = $explode[2];
$created_date = "$month-$day-$year $part2";