I have selected two dates in a date range picker and stored them in one data base column but it only stores one date, like: 0000-00-00
. I can't store two dates in one column so I want to split this string into two variable by hyphen (-).
This is my date range function:
<script>
$(function () {
//Initialize Select2 Elements
$('.select2').select2();
//Date range picker
$('#bilty_date_range').daterangepicker();
});
</script>
This is my date insert code:
'bilty_date_range' => date('y-m-d',strtotime($bilty_date_range)),
I am selecting the date like this:
The backend result is like this: 11/07/2018 - 12/25/2018
.