Skip to main content

How to Set or Change Time Zone in Ubuntu 16.04 LTS / CentOS 7 Linux ?

Server Time Zone is very important for any Internet Services. My Time Zone is Asia/Dhaka . Follow the steps to configure your Time Zone.
CentOS 7:
# timedatectl list-timezones
# timedatectl list-timezones | grep Asia

# mv /etc/localtime /root/localtime.old
# ln -s /usr/share/zoneinfo/Asia/Dhaka /etc/localtime

# timedatectl set-ntp yes
# timedatectl set-timezone Asia/Dhaka
# systemctl restart systemd-timedated.service

# timedatectl
      Local time: Wed 2018-10-31 11:15:50 +06
  Universal time: Wed 2018-10-31 05:15:50 UTC
        RTC time: Wed 2018-10-31 05:15:50
       Time zone: Asia/Dhaka (+06, +0600)
     NTP enabled: yes
NTP synchronized: yes
 RTC in local TZ: no
      DST active: n/a

# hwclock
Wed 31 Oct 2018 11:21:37 AM +06  -0.084209 seconds
 
How to Set or Change Time Zone in Ubuntu 16.04 LTS / CentOS 7 Linux ?

Ubuntu 16.04 LTS:
# timedatectl list-timezones
# timedatectl list-timezones | grep Asia

# mv /etc/localtime /root/localtime.old
# ln -s /usr/share/zoneinfo/Asia/Dhaka /etc/localtime

# timedatectl set-ntp yes
# timedatectl set-timezone Asia/Dhaka
# systemctl status systemd-timesyncd

# timedatectl status
      Local time: Wed 2018-10-31 11:15:50 +06
  Universal time: Wed 2018-10-31 05:15:50 UTC
        RTC time: Wed 2018-10-31 05:15:50
       Time zone: Asia/Dhaka (+06, +0600)
     NTP enabled: yes
NTP synchronized: yes
 RTC in local TZ: no


# hwclock
Wed 31 Oct 2018 11:21:37 AM +06  -0.084209 seconds

Comments