❤️ AZDIGI has officially updated to a new blog system. However, some posts may have incorrect or mismatched images. Please click the Report article button at the bottom of the post so AZDIGI can update as quickly as possible. Thank you!

In some cases, when your server has the incorrect timezone affects the synchronization of information or the tasks that you set the schedule. And in this article, AZDIGI will show you to change the Timezone on the CentOS server.

Check current timezone

# timedatectl

Below shows the system time zone set America/New_York (EST, -0500)

 Local time: Tue 2019-12-17 21:42:07 EST
 Universal time: Wed 2019-12-18 02:42:07 UTC
 RTC time: Wed 2019-12-18 02:42:06
 Time zone: America/New_York (EST, -0500)
 NTP enabled: yes
NTP synchronized: yes
 RTC in local TZ: no
 DST active: no
 Last DST change: DST ended at
 Sun 2019-11-03 01:59:59 EDT
 Sun 2019-11-03 01:00:00 EST
 Next DST change: DST begins (the clock jumps one hour forward) at
 Sun 2020-03-08 01:59:59 EST
 Sun 2020-03-08 03:00:00 EDT

Change Timezone

# ls -l /etc/localtime
  • The result will return as follows:
Output
lrwxrwxrwx. 1 root root 38 Mar 21 2018 /etc/localtime -> ../usr/share/zoneinfo/America/New_York 

List all available timezones, you can list files in /usr/share/zoneinfo directory or use timedatectl command

# timedatectl list-timezones
Output
...
America/Tijuana
America/Toronto
America/Tortola
America/Vancouver
America/Whitehorse
America/Winnipeg
...
Asia/Ho_Chi_Minh
...

When you decide to change the time zone to which zone you make the change with the following command:

# timedatectl set-timezone your_time_zone
  • For example, # timedatectl set-timezone Asia/Ho_Chi_Minh

Recheck after change

# timedatectl
Output 
 Local time: Wed 2019-12-18 09:45:01 +07
 Universal time: Wed 2019-12-18 02:45:01 UTC
 RTC time: Wed 2019-12-18 02:45:01
 Time zone: Asia/Ho_Chi_Minh (+07, +0700)
 NTP enabled: yes
NTP synchronized: yes
 RTC in local TZ: no
 DST active: n/a
  • Hotline 247: 028 888 24768 (Ext 0)
  • Ticket/Email: You can use your email to register for the service and send it directly to: support@azdigi.com
Share:
This article has been reviewed by AZDIGI Team

About the author

Thạch Phạm

Thạch Phạm

Đồng sáng lập và Giám đốc điều hành của AZDIGI. Có hơn 15 năm kinh nghiệm trong phổ biến kiến thức liên quan đến WordPress tại thachpham.com, phát triển website và phát triển hệ thống.

10+ years serving 80,000+ customers

Start your web project with AZDIGI