Pregunta

I am running MYSQL in UTC by default. I want all selects to be done in the user's local time, but all inserts and updates to be in UTC. How do I do this? I know of the CONVERT_TZ function, but I don't want to have to wrap every select if at all possible. Is there a way to set the users timezone ONCE after they log in? I am using CodeIgniter and non-persistent so I assume I have to set it every time I connect?

Any advice is appreciated.

¿Fue útil?

Solución

in Your index.php file in the root Folder use:

date_default_timezone_set('Asia/Kolkata');

And Set your time zone here. All codeigniter Requests pass through this file. So it will set Your time Zone

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top