I have a date (\"mm/dd/yyyy\") and I want to convert it to a MySQL DATE data type (like yyyy-mm-dd)
How do I do it with PHP?
function date2mysql($date) { list($month, $day, $year) = explode('/', $date); $timestamp = mktime(0, 0, 0, $month, $day, $year); return date("Y-mm-d",$timestamp); }
see the date manual for the format