I am using cakephp 3.x, I have one form in which one field has a date. in the backend I use mysql.
my field structure is in mysql dob
type date
.
now in cakephp 3.x I used the below syntax to create input.
echo $this->Form->input('dob', array(
'label' => (__('Date of Birth')),
'type' => 'text',
'required' => false,
'class' => 'form-control date'
));
and I used bootstrap datetimepicker for example
$('.date').datetimepicker({
format: 'YYYY-MM-DD'
});
now when i submit the at form and i print_r
request data at this time i got this field like this
[
....
'dob' => '2016-02-11',
....
]
but when I save the record and look in the database then it shows me a random date like 2036-10-25
can someone help me?
source
share