I'm getting a date in form and in firefox the DATE field behaves like a normal text field. Hi, I have a date in the format dd/mm/yyyy
, so I have a function that converts this date to save in MariaDB (MySql). The problem is that in chrome the date is already formatted, so it does not need this formatting! >
What I want is to check to see if this date is already in the right format, because if you want to skip the formatting.
follows the function:
function traduz_data_para_banco($parametro){
if($parametro === null){
echo "data nula";
return;
}
$data_picada = explode("/",$parametro);
$data_USA = "{$data_picada[2]}" . "-" . "{$data_picada[1]}" . "-" . "{$data_picada[0]}";
return $data_USA;
}