I am trying to get familiar with different timezones. My database (mySQL) is set to EET time(+02:00) (I hoped it was UTC), but in any case, our Cakephp implementation is retrieving the records as UTC. Our
timestamp column has a
2019-12-19 12:44:27 found in our mySQL, is
2019-12-19 10:44:27 in our implementation.
I have created the following query considering a
+04:00 timezone, in order to get all the records that happened in today's timezone (meaning the +04:00)
SELECT company_id, url FROM behaviour WHERE CONVERT_TZ(timestamp,'+00:00','+04:00') >= CONVERT_TZ(curdate(),'+00:00','+04:00') ORDER BY id DESC
The whole logic is starting to get too complex for my brain to handle and I would like someone to help me understand if my query works as expected.