Convert datepicker to mysql datetime format in PHP
Is there a way to convert a date in this format: 08/19/2014 1:45 pm
in MySQL datetime format such as 2014-08-19 13:45:00.
I tried using something like
date("Y-m-d H:i:s", $myTime);
but I don't think it likes "pm" and it returns 1969-12-31 giving an error:
"Incorrectly formed numeric value"
+3
source to share
2 answers