How to set format for datetime in a correct way?

Hi guys,
following code should send datetime valuie to searchModel, but value being sent to database is faulty. How to define saveFormat in a correct way in order to match with mysql?

<?=
$form->field($model, 'aktualisiert_am')->widget(\kartik\datecontrol\DateControl::classname(), [
    'type' => \kartik\datecontrol\DateControl::FORMAT_DATETIME,
    'saveFormat' => 'php:Y-m-d H:i:s',
    'ajaxConversion' => true,
    'options' => [
        'pluginOptions' => [
            'placeholder' => Yii::t('app', 'Aktualisiert am'),
            'autoclose' => true,
        ]
    ],
]);
?>

This is what I get for 01.04.2019 8 30.a.m
2019-30-01 08:3030

This is fixing my problem:

    <?=
$form->field($model, 'angelegt_am')->widget(kartik\widgets\DateTimePicker::classname(), [
    'options' => ['placeholder' => 'Enter event time ...'],
    'pluginOptions' => [
        'autoclose' => true,
        'format' => 'yyyy-mm-dd hh:ii:ss'
    ]
]);
?>
3 Likes