Nội dung
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
# 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