Changing the MySQL Timezone |
Hi,
Before in CodeIgniter 3 I used to change the MySQL timezone with a query inside MY_Controller. Now in CodeIgniter 4 I'm doing the same in the BaseController: PHP Code: public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger) However when I retrieve data from the database, the datetimes are still on mysql server timezone UTC. Ofcourse I can converse every datetime I retrieve from the database in my PHP code, however I prefer not to do this, as it will require me to do this on many points. Thank you, Roel. I solved the issue, it seems if I use time or datetime in the data column type it does notchange it by timezone, only when using the timestamp column type.
I found this, not sure if it will help you.
Should MySQL have its timezone set to UTC? What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |