Store the time of an input type Time field in a column of type Time

0

I'm working on a website that schedules real estate surveys, and I need to store in MySQL the time the person requested the visit. I'm using an input field in HTML of type Time.

The field in the table is in the time data type with length 6.

When I try to insert via SQL, via AJAX, it is not working. I believe it has something related to formatting the value of time ...
Can someone help me and guide how should I proceed to insert the value?

$txtDataVistoria_formatada = date("Y-m-d", strtotime($txtDataVistoria));

$txtHoraVistoria_pre = new DateTime($txtHoraVistoria);
$txtHoraVistoria_formatada = $txtHoraVistoria_pre->format('H:i:s.u');
    
asked by anonymous 28.01.2018 / 22:59

0 answers