I
I
ImPuuLsE2015-09-15 15:48:07
Yii
ImPuuLsE, 2015-09-15 15:48:07

How to sort by date in this format?

Hello! the date is stored in the database in this form - 07/17/2015. How to sort it in descending order? I do this: but it is sorted only by the day, not taking into account the month
->orderBy(['created_at'=>SORT_DESC])

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
lyeskin, 2015-09-15
@lyeskin

Convert date using MySQL functions to DATE and then sort.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question