Setting Timezone on a Linux Server

Setting Timezone on a Linux Server

Generally when a server is setup, the time set on the server is as per the timezone of the area where the datacentre is located. But for a web hosting uk server the clients are spread all over the world with different timezones. I will recommend to set the the UTC timezone.

The files related to various timezones are located at /usr/share/zoneinfo on the server. To set the timezone to UTC:

Edit the file

# vi /etc/sysconfig/clock

change the line ‘UTC=false’ to ‘UTC=true’.

Now set the local timezone to UTC

# ln -s /usr/share/zoneinfo/UTC /etc/localtime

Check the time by

# date

The above was an example to set the timezone to UTC. You can create symlink for any timezone by using above method to set your desired timezone.

Latest posts by Sam (see all)


Leave your comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.