I have a view, like this:
<div class="input-append date the_date">
<input data-format="yyyy-MM-dd HH:mm:ss" type="text" readonly>
</div>
and js, like this:
var the_date = $('.the_date > input').val();
// [DATA FOR SERVER]:
var data={ the_date : the_date }
And when I submit the date form, the data array is sent to a controller which inserts the date via a model function.
However the selected date is NOT inserted to the database.
I can alert(the_date); from js, I can echo $the_date; from the controller and I can even echo $the_date; from the model, however $the_date does not go into the database.
I have a standard datetime field in MySQL called the_date which has the standard MySQL datetime format of "yyyy-MM-dd hh:mm:ss", and I can't figure out why the_date is not going into the db.
I am using CodeIgniter's Active Record for inserts, and every other insert works fine. I can insert dates with:
'the_date' => date("Y-m-d H:i:s")
for example, and I can also say:
'the_date' => '2002-11-11 12:12:12')
But the default datetime of "0000-00-00 00:00:00" is inserted everytime I use the datetimepicker from Bootstrap....