Mysql
 sql >> Database >  >> RDS >> Mysql

converti datepicker date in mysql date

Dovresti usare DateTime::createFromFormat

Es:

$date = DateTime::createFromFormat('m/d/Y','02/10/2015');
echo $date->format("Y-m-d");
// 2015-02-10

Quindi nel tuo caso

$from = $_GET['from'];
$date = DateTime::createFromFormat('m/d/Y',$from);
$from_date = $date->format("Y-m-d");