view:
<?= $form->field($model, ‘fecha_ingreso’)->widget(DateTimePicker::classname(), [
'options' => ['placeholder' => 'Seleccione la fecha de ingreso'],
'pluginOptions' => [
'autoclose' => true,
'format' => 'yyyy/dd/mm hh:ii:ss',
]
]);?>
//////////
fecha_ingreso is integer
itma
(Andrzej Bernat)
2
Use php function strtotime() setting the property like this
$model->fecha_ingreso = strtotime($model->fecha_ingreso).
Not tested but should work.
i had change the widget because the datatime picker not have this opction to save:
‘saveFormat’ => ‘strtotime($model->fecha_ingreso)’,
or more easy… ‘saveFormat’ => ‘php:U’, thanks!