$dob1=trim($_POST['txt_dob']);//$dob1='dd/mm/yyyy' formatlist($d, $m, $y) = explode('/', $dob1);$mk=mktime(0, 0, 0, $m, $d, $y);$dob_disp1=strftime('%Y-%m-%d',$mk);
if you can convert string date to date formate direct using strtotime() function this not give valid date
i have all ready faced this problem
i hope this code will helpfull to you... :)