Welcome Guest, Not a member yet? Register   Sign In
Database Timezone
#1

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
Reply
#2

Read this it may help you.

How To Synchronize Your PHP and MySQL Timezones
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

(06-15-2016, 03:31 AM)InsiteFX Wrote: Read this it may help you.

How To Synchronize Your PHP and MySQL Timezones

No help!
Reply
#4

It was a great article though.

It sounds like you need to contact your web host.

Paul.
Reply
#5

(06-15-2016, 04:33 PM)PaulD Wrote: It was a great article though.

It sounds like you need to contact your web host.

Paul.

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!!!
Reply




Theme © iAndrew 2016 - Forum software by © MyBB