How to Set or Change the Time Zone in Linux

Checking the Current Time Zone

1
timedatectl

Changing the Time Zone in Linux

Before changing the time zone, you’ll need to find out the long name of the time zone you want to use. The time zone naming convention usually uses a “Region/City” format.

To view all available time zones, use the timedatectl command or list the files in the /usr/share/zoneinfo directory:

1
timedatectl list-timezones

Once you identify which time zone is accurate to your location, run the following command as root or sudo user:

1
timedatectl set-timezone <your_time_zone>

For example, to change the system’s timezone to Asia/Shanghai you would type:

1
timedatectl set-timezone Asia/Shanghai

To verify the change, invoke the timedatectl command again:

1
timedatectl

NTP Server

1
ntpdate ntp.aliyun.com

How to Set or Change the Time Zone in Linux
https://www.hardyhu.cn/2022/01/26/How-to-Set-or-Change-the-Time-Zone-in-Linux/
Author
John Doe
Posted on
January 26, 2022
Licensed under