How To Change Timezone on a CentOS 6 and 7

Lets assume that you want to change your server time zone to ‘Asia/HongKong’ on CentOS 7 server. And as its currently using America/New_York.

You can easily change timezone in CentOS Linux using the following methods:
1. View the current timezone by running the date command and ls command.

[root@server1 ~]# date
Tue Sep 13 23:28:25 EDT 2016

[root@server1 ~]# ls -l /etc/localtime
lrwxrwxrwx. 1 root root 38 Sep 13 21:52 /etc/localtime -> ../usr/share/zoneinfo/America/New_York

2. Find the timezone available you can use.

[root@server1 ~]# timedatectl list-timezones


[root@server1 ~]# timedatectl list-timezones | grep Asia

3. Change the current Timezone to Asia/HongKong

[root@server1 ~]# timedatectl set-timezone Asia/Hong_Kong

4. Verify the date if it change

[root@server1 ~]# date
Wed Sep 14 11:30:13 HKT 2016




Spread the love

Leave a Reply

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