I have some problems converting an HTML date to a MySQL date.
I have a form with an input field (type="date"), which outputs a date in format 29/04/2015
Whenever I click on the Send button, I send the date via PHP to a database which has a column in DATE format (2015-04-29)
Unfortunately the result is that the date is always stored as 1970-01-01, which means the conversion didn't work out as expected.
My conversion code, right now, is:
@$entryDate = str_replace("/", "-", $_POST['entryDate']);
@$entryDate = date('Y-m-d', strtotime($entryDate));
Do you have any idea why the conversion is not working?
Thanks a lot for your help