A
A
Alexander Stepanov2020-01-26 18:23:05
Yii
Alexander Stepanov, 2020-01-26 18:23:05

Why doesn't datetime data pass?

It was necessary to make 2 fields with date and time input, screwed datetime from Kartik, in the model I registered the rules for these 'datetime' fields, but when saving, it swears at the wrong format.
I read about the format - it seems to be 'yyyy-mm-dd hh:ii:ss' by default. I changed the rule to 'safe' and just commented out the line with this rule - I got the correct date and
time
I would like to understand..

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artem, 2020-01-26
@Exebeche

['datetime', 'date', 'format' => 'php:Y-m-d h:i:s']

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question