Answer the question
In order to leave comments, you need to log in
How to compare dates in different formats in Yii2-Postgresql?
You need to compare dates in different formats in the query. If you make a simple query, then you can use TIMESTAMP in pg, but if you collect a query from the framework, then the TIMESTAMP operator is escaped:
("table"."value::timestamp" = '1980-09-27::timestamp') or " TIMESTAMP table"."value" = 'TIMESTAMP 1980-09-27'
How to deal with this?
Functions (like CAST) are not escaped, they work normally. Can I somehow tell yii that TIMESTAMP is an operator and should not be merged with a string?
Or some analogue of TIMESTAMP on the side of the database, but in the form of a function?
Or the function of casting to some format
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question