I am using this Bootstrap DatePicker: code below
<input class="datepicker" name="date">
<script> //date picker js
$(document).ready(function() {
$('.datepicker').datepicker({
todayHighlight: true,
"autoclose": true,
});
});
</script>
and I capture that in my PHP here:
$date = $_POST['date'];
The problem is that the DatePicker gives me the format dd/mm/yyyy
when I need it yyyy-mm-dd
in my $date variable. How do I reformat this?