Set timezone in CentOS

From HostThyself

Jump to: navigation, search

When you hosting server is in another timezone, you may want to set it to corresponds to you local timezone.

On CentOS there are 2 methods.

[edit] With system-config-date

Install system-config-date with yum

# yum install system-config-date
# system-config-date

Installing system-config-date also installs a number of other dependent packages. If you want to keep your system lean, use the next method.

[edit] Edit /etc/localtime

  1. Look up appropriate timezone info in /usr/share/zoneinfo/
  2. Create a symbolic link to the right timezone, e.g.
# ln -s /usr/share/zoneinfo/Asia/Shanghai localtime
Personal tools