I am trying to convert this date format mm-dd-yyyy to yyyy-mm-dd I am using strtotime function but it is not coverting properly. date('Y-m-d', strtotime('06-15-2014'))
It is returning date in this format 1970-01-01 01:00:00
I am trying to convert this date format mm-dd-yyyy to yyyy-mm-dd I am using strtotime function but it is not coverting properly. date('Y-m-d', strtotime('06-15-2014'))
It is returning date in this format 1970-01-01 01:00:00
String functions work too.
$in = "05-14-2004"; // why would you even write dates like this?
$out = substr($in,-4)."-".substr($in,5);