F
F
F(x)2018-03-07 13:36:17
Yii
F(x), 2018-03-07 13:36:17

How to filter data by hours?

How to filter data by hours?
How and in what format to send the parameter in the database?
My database will store int(11) format.
I need to send this form: 5a9fc066cebca380318412.png
How to do this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2018-03-07
@slo_nik

Good afternoon.
A public property is created in the search model.
In the search model validation rules, we indicate in what format the data for this variable is expected.

rules => [
    ['time', 'date', 'format' => 'php:H:i']
]

When performing a search, the time in the database is compared with the time from the form
That's about it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question