Showing posts with label timezone. Show all posts
Showing posts with label timezone. Show all posts

Saturday, December 13, 2008

Change MySQL Timezone

If your server is in a different timezone, a quick fix is to update the timezone of the server. I did that previously, but that turned out is not enough. I had to change the timezone of mysql daemon too. Here is how I did it:

SET GLOBAL time_zone = 'America/Los_Angeles';

SET SESSION time_zone = 'America/Los_Angeles';

Check it using:
SELECT @@global.time_zone, @@session.time_zone;

Sunday, November 30, 2008

How to change Redhat Linux timezone

Our dedicated server is in CST timezone, so we thought of changing the timezone to PST, where we are. Here are the instructions I followed:

#timeconfig

This is a visual way of setting the timezone, but I am not sure if it actually did anything.


So, I tried manual way by following these steps:
#mv /etc/localtime /etc/localtime-old
#ln -sf /usr/share/zoneinfo/US/Pacific /etc/localtime
#rdate -s time.nist.gov

Because of our server firewall, the above step timedout. So I tried the following, which timed out too:
#ntpdate pool.ntp.org

So I set the time manually, and then synced the hardware clock:
#date -s "3:38"
#hwclock --systohc --utc
#hwclock --show