In the model I make a request to the database, I get all the data that I need and the date in the format 2016-10-02 09: 45: 25 + 03 . $ query = (new \ yii \ db \ Query ()) ->
select ('cd.date day,
c.host_id, cd.customer_id ')
-> from ('customer_download cd')
-> leftJoin ('customer c', '"c". "id" = "cd". "customer_id"')
But I need to bring this date to mind 2016-10-02 09:45:25 . In the query, I did it like this: to_char (cd.date, 'YYYY-MM-dd HH24: MI') as day
But when I insert this code in the first request to_char (cd.date, 'YYYY-MM-dd HH24: MI') day, I get an error syntax error at or near "AS" How to do it correctly?