• 0

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191


File: /var/www/html/cnasolution/site/application/views/question.php
Line: 191
Function: _error_handler

File: /var/www/html/cnasolution/site/application/controllers/Questions.php
Line: 419
Function: view

File: /var/www/html/cnasolution/site/index.php
Line: 315
Function: require_once

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 timestamp type.

So 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.

Tahnk you

Download script demo [LINK] [Origin]
Download script demo [LINK 2] [Onedrive] Download script demo [LINK 2] [Google drive]