hello friends I have a problem with the dates pause .. in my view I have a datetimepicker of (bootstrap 4) with the format 12/06/2019 12:00:00 and what I need is to pass it to the format that accepts mysql 2019-06-12 12:00:00
try to do it from js but it did not work
$(function () {
$('#startdate').datetimepicker({
useCurrent: false,
format: 'Y-MM-D H:mm',
autoclose:true,
minDate: moment()
});
that's how I'm trying from my controller but it has given me an error :(
$promociones->fecha_inicio = Carbon::createFromFormat('Y-m-d H:i',$request->fecha_inicio)->toDateTimeString();
$promociones->fecha_fin = Carbon::createFromFormat('Y-m-d H:i',$request->fecha_fin)->toDateTimeString();
</div>