How the time of 2014-1-1 after submission became 2014-01-01
When I import data using an Excel table, for example:
$KQ _date= $data->sheets[0][' cells ' [$i][3]//This is the 3rd column, if it's 2014-1-1
So how to make $kq_date write to the database when it becomes 2014-01-01, because if it doesn't become 2014-01-01, writing to a database field becomes 0000-00-00, and I don't know what's going on.
------to solve the idea----------------------
echo Date (' y-m-d ', strtotime (' 2014-01-01 '));
------to solve the idea----------------------
If it's a string, you can convert it.
$d = ' 2014-1-1 ';
echo Date (' y-m-d ', Strtotime ($d));
------to solve the idea----------------------
This should be the wrong type of field that your database is saved in.
One is to change the type of field saved by the database
The second is to use the date and Strtotime functions.