i am using cakephp 3.x, i have one form in which one field is of date. in backend i am using mysql.
my field structure in mysql is dob of type date.
now in cakephp 3.x i had use 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 had used bootstrap datetimepicker like,
$('.date').datetimepicker({
format: 'YYYY-MM-DD'
});
now when i submit the form at and i print_r the request data at that time i got this field like this
[
....
'dob' => '2016-02-11',
....
]
but when i save the record and look in database then it show me random date like 2036-10-25
can anyone help me please?
en_USthen. In that case this seems to be a duplicate of stackoverflow.com/questions/33734683/…. You should be able to apply similar todateinstead ofdatetime, respectively to\Cake\I18n\Dateinstead of\Cake\I18n\Time