php converte to date code example
Example 1: convert string to date php
$s = '08/11/2010 19:37:02';
$date = strtotime($s);
echo date('Y-m-d H:i:s', $date);
Example 2: convert date in php
$originalDate = "2010-03-21";
$newDate = date("d-m-Y", strtotime($originalDate));