Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+4 votes
872 views
in Q2A Core by
My website is hosted on a server that has a different timezone setted from the one i want to use and i need to change the timezone for Q2A.

I tryed to add the following line in qa-base.php but it is not having any effect and question dates are still setted on the server timezone:

date_default_timezone_set("Europe/Rome");

How can i change the timezone so whan the questions get saved in the "qa_posts" db table the "created" field is setted to the right timezone?

1 Answer

+2 votes
by
All times are set by MySQL rather than PHP. So you would have to adjust the time zone of your MySQL installation, via the appropriate setting. I can't give you more specific information than that, but this page will probably help:

http://dev.mysql.com/doc/refman/5.0/en/time-zone-support.html
by
The problem is that i don't have access to my Mysql configuration since the website is hosted on a shared hosting service.

I will try to find a workaround and give feedbacks if i will success
by
If you don't have access or cannot do it via any control panel, then you should contact your hosting provider. If you have access via SSH to your server: Change timezone of apache via "sudo dpkg-reconfigure tzdata", afterwards restart mysql: "service mysql restart"
by
I have the same problem, but the MySQL timezone is correct while the timezone set in Q2A didn't? I found gmdate() function in it's core.
...