I have a datepicker that shows the date in the following format: date('d/m/Y')
the date is represented as: 29/06/2017
.
The date column in my database accepts the format: Y-m-d
. Witch is represented as: 2017-06-29
.
I am trying to convert the date with the following script:
$single_cal4 = date("Y-m-d",strtotime($single_cal4));
When I execute the PHP script that sends the date to the database the date will not insert. I get the date 1970-01-01
in my database.
Does someone know why this is happening and what I am doing wrong?