V
V
Victor Umansky2017-02-04 00:57:53
Yii
Victor Umansky, 2017-02-04 00:57:53

Yii2. Archive - displaying records by month?

Hello everyone!
Please help organize the output of the archive records by month!
Example:
January
- 1st entry
- 2nd entry
February
- 3rd entry -
4th entry ,
etc. MONTH)')->all(); But it doesn't work, oh yes, created_at is stored in the database as an INTEGER. I think that someone did this, can you share with the code or explain how to do it ?! Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2017-02-04
@Uman

Goodnight.
Try like this:
The date of creation is recorded along with the time the article was created, and so, the time is cut off from the timestamp and the comparison goes only by year, month and day

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question