Home Linux ServerLinux Fundementals CHow to change Timezone on CentOS

CHow to change Timezone on CentOS

by Thạch Phạm

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 730 24768 (Ext 0)
  • Ticket/Email: You can use your email to register for the service and send it directly to: support@azdigi.com
Đánh giá

Bài viết cùng chuyên mục

AZDIGI – Không chỉ là đơn vị hàng đầu trong lĩnh vực Web Hosting và Máy chủ, chúng tôi mong muốn mang lại những kiến thức bổ ích nhất và luôn cập nhật thường xuyên cho cộng đồng người đam mê thiết kế website, công nghệ,…

Vui lòng không sao chép nội dung nếu chưa xin phép. Designed and Developed by PenciDesign