I know this question has been asked multiple times but nothing works for me.
I want to pull the date from the input and store it in my DB (MySQLi).
This is what I tried
$ses_s = $_POST['ses_date_s'];
$ses_n_s = date("Y-m-d", strtotime($ses_s));
$q = 'INSERT INTO date_t (ses_date_s,) VALUES (?)';
$stmt = mysqli_prepare($dbc, $q);
mysqli_stmt_bind_param($stmt, 's', $ses_n_s);
mysqli_stmt_execute($stmt);
But it won't work.
Date I enter: 17/07/2014 (echo $ses_s)
Date I get converted: 1970-01-01 (Unix start) ($ses_n_s)
What am I doing wrong?
P.S. How do I pull the date in revers, I want the date to be displayed d/m/Y and not Y/m/d (like in DB)?
Thanks in advance.
EDIT:
I found the problem up (thanks to Jonathan) i used dd/mm/yyyy not mm/dd/yyy
So if I can change my question how do I convert dd/mm/yyy to yyyy/mm/dd