Linux timezone not changing

user173141 asked:

Unable to change the timezone to PST8PDT even after trying all the possible methods

[root@test ~]# date
Tue May 10 07:24:18 EDT 2016
[root@test ~]# ll /etc/localtime
lrwxrwxrwx 1 root root 27 May 10 06:35 /etc/localtime -> /usr/share/zoneinfo/PST8PDT
[root@test ~]# cat /etc/profile | grep TZ
export TZ=PST8PDT
[root@test ~]# date
Tue May 10 07:24:57 EDT 2016

[root@test ~]# echo $TZ
[root@test ~]# ls /root/.profile
ls: /root/.profile: No such file or directory

Any other method to change ?

[root@test ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.10 (Tikanga)

My answer:

You should not use the ancient style “timezones” like PST8PDT. These have been deprecated and are not even available at all since at least RHEL 6 (2010).

Instead, use the current ones, e.g. America/Los_Angeles.

export TZ=America/Los_Angeles
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime

View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.