Created a model with a dateTime field called ‘until’, the name is not important just that it is a date time.
Here is it’s validation in the rules of the model.
['until', 'datetime', 'format' => 'Y-m-d H:i:s'],
Later after I instantiate the model and update the field I get a validation error.
$model->until = '2017-10-15 14:30:04';
$eventRepeat->validate();
$errors = $model->errors;
$errors[‘until’][0] will then be ‘The format of Until is invalid.’
I was not expecting this error.