![]() |
Database Timezone - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: Best Practices (https://forum.codeigniter.com/forumdisplay.php?fid=12) +--- Thread: Database Timezone (/showthread.php?tid=65462) |
Database Timezone - pb.sajjad - 06-14-2016 Hi to all developers... In my web app, some of datetime insert automatically on insert data (using timestamp) and some manually (set with php date function and then insert). I've set date_default_timezone_set in index.php and everything is well on local. Now I move app on live server and on testing, see the timestamp (on insert a row in db) is different from date_default_timezone_set!!! I search a lot and see other's guide, but nothing happened! "$this->db->query('SET time_zone = ""');", "add date_default_timezone_set", "change $config['time_reference'] in config file", "create a parent model and set time zone in that" or... none of them did not worked for me! How could solve this? Could you guide me to handle this issue? thanks RE: Database Timezone - InsiteFX - 06-15-2016 Read this it may help you. How To Synchronize Your PHP and MySQL Timezones RE: Database Timezone - pb.sajjad - 06-15-2016 (06-15-2016, 03:31 AM)InsiteFX Wrote: Read this it may help you. No help! RE: Database Timezone - PaulD - 06-15-2016 It was a great article though. It sounds like you need to contact your web host. Paul. RE: Database Timezone - pb.sajjad - 07-02-2016 (06-15-2016, 04:33 PM)PaulD Wrote: It was a great article though. I contact. they said "You will not be able to change any MySQL settings on shared hosting but you can specify your timezone in .htaccess.". How could handle this?! Should forget timestamp type and use datetime? but for paypal transactions, I should store timestamp!!! |