@bhhussain try this
$('.date-picker').datepicker({
format: 'yy/mm/dd',
autoclose: true,
todayHighlight: true
});
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi,
I have date format (dd/mm/yyyy) and when I try to insert into table i am getting error message as below.
SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect date value
Default date format of mysql is yyyy/mm/dd hh:mm and I want to convert my date format into mysql format to insert the data.
I am using the bootstrap date picker as below
$( ".datepicker" ).datepicker({ format: 'dd-mm-yyyy' });Can any one please help me.
Thank you
@bhhussain Actually I saw it now in your datepicker :)
so you should use this instead:
$date = Carbon::createFromFormat('d-m-Y', $request->th_bill_dt);
not vice-versa :)
Please or to participate in this conversation.