I have events that have a datetime input for the start and end of the event. If I try to save the start 12-8-2015 at 11:30am and the end 12-8-2015 at 12:30pm the event gets save but it makes the date 12-9-2015. I don't know why it is doing this. I have tried adding validation rules like 'datetime', and 'notBlank', but that would just give me errors saying the fields were invalid and/or required. So I took the validation rules out. Any suggestions why the behavior is so weird with datetime?
Form:
<?= $this->Form->create($event, ['type' => 'file']);?>
<fieldset>
<legend><?= __('Edit Event'); ?></legend>
<?php
echo $this->Form->input('id');
echo $this->Form->input('event_type_id');
echo $this->Form->input('event_img', ['type' => 'file']);
echo $this->Form->input('title');
echo $this->Form->input('location');
echo $this->Form->input('details');
echo $this->Form->input('cost');
echo $this->Form->label('Start Time');
echo $this->Form->datetime('start', ['interval' => 15, 'timeFormat' => 12]);
echo $this->Form->label('End Time');
echo $this->Form->datetime('end', ['interval' => 15, 'timeFormat' => 12]);
echo $this->Form->input('all_day');
echo $this->Form->input('status', ['options' => [
'Scheduled' => 'Scheduled','Confirmed' => 'Confirmed','In Progress' => 'In Progress',
'Rescheduled' => 'Rescheduled','Completed' => 'Completed'
]
]
);
?>
</fieldset>
<?= $this->Form->button(__('Submit', true));?>
<?= $this->Form->end(); ?>