1$date = DateTime::createFromFormat('d/m/Y', "24/04/2012");
2echo $date->format('Y-m-d');
1$old_date = date('l, F d y h:i:s'); // returns Saturday, January 30 10 02:06:34
2$old_date_timestamp = strtotime($old_date);
3$new_date = date('Y-m-d H:i:s', $old_date_timestamp);
4
1$var = '20/04/2012';
2$date = str_replace('/', '-', $var);
3echo date('Y-m-d', strtotime($date));