How to configure Date and Time using ‘ timedatectl ‘ on CentOS 7

The timedatectl utility use to change the current Date and Time, set the time zone, and enable automatic synchronization of the system clock with a remote server. To display the current date and time  with the detailed information about the configuration of the system and hardware clock you use  timedatectl command as shown below.

[root@localhost ~]#  timedatectl
Local time: Sun 2016-02-28 23:56:30 IST
Universal time: Sun 2016-02-28 18:26:30 UTC
RTC time: Sun 2016-02-28 18:26:30
Time zone: Asia/Kolkata (IST, +0530)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
DST active: n/a
[root@localhost ~]#

Change The Current Time with  timedatectl :

To change the Current Time you are login as a root

timedatectl set-time HH:MM:SS 

HH   – Hour

MM – Minute

SS   –  Second

[root@localhost ~]# timedatectl set-time 23:11:55
[root@localhost ~]# timedatectl
      Local time: Mon 2016-02-29 23:12:03 IST
Universal time: Mon 2016-02-29 17:42:03 UTC
RTC time: Mon 2016-02-29 17:42:03
Time zone: Asia/Kolkata (IST, +0530)
NTP enabled: no
NTP synchronized: no
RTC in local TZ: no
DST active: n/a
[root@localhost ~]#

Change The Current Date with  timedatectl :

timedatectl set-time YYYY-MM-DD


YYYY -Four digit Year

MM   -Two digit Month

DD     -Tow digit Day


[root@localhost ~]# timedatectl set-time 2011-11-12
[root@localhost ~]# timedatectl
      Local time: Sat 2011-11-12 00:00:06 IST
Universal time: Fri 2011-11-11 18:30:06 UTC
RTC time: Fri 2011-11-11 18:30:07
Time zone: Asia/Kolkata (IST, +0530)
NTP enabled: no
NTP synchronized: no
RTC in local TZ: no
DST active: n/a
[root@localhost ~]#


Change The Time Zone with  timedatectl :

To check the time-zone nearest your present location you use list-timezone option with timedatectl command

[root@localhost ~]# timedatectl list-timezones | grep Asia
Asia/Aden
Asia/Almaty
Asia/Amman
Asia/Anadyr
Asia/Aqtau
Asia/Aqtobe
Asia/Ashgabat
Asia/Baghdad
Asia/Bahrain
Asia/Baku
Asia/Bangkok
Asia/Beirut
Asia/Bishkek
Asia/Brunei
Asia/Chita
Asia/Choibalsan
Asia/Colombo
Asia/Damascus
Asia/Dhaka

Asia/Dili
Asia/Dubai
Asia/Dushanbe
Asia/Gaza
Asia/Hebron
Asia/Ho_Chi_Minh
Asia/Hong_Kong
Asia/Hovd
Asia/Irkutsk
Asia/Jakarta
Asia/Jayapura
Asia/Jerusalem
Asia/Kabul
Asia/Kamchatka
Asia/Karachi
Asia/Kathmandu
Asia/Khandyga
Asia/Kolkata
Asia/Krasnoyarsk
Asia/Kuala_Lumpur
Asia/Kuching
Asia/Kuwait
Asia/Macau
Asia/Magadan
Asia/Makassar
Asia/Manila
Asia/Muscat
Asia/Nicosia
Asia/Novokuznetsk
Asia/Novosibirsk
Asia/Omsk
Asia/Oral
Asia/Phnom_Penh
Asia/Pontianak
Asia/Pyongyang
Asia/Qatar
Asia/Qyzylorda
Asia/Rangoon
Asia/Riyadh
Asia/Sakhalin
Asia/Samarkand
Asia/Seoul
Asia/Shanghai
Asia/Singapore
Asia/Srednekolymsk
Asia/Taipei
Asia/Tashkent
Asia/Tbilisi
Asia/Tehran
Asia/Thimphu
Asia/Tokyo
Asia/Ulaanbaatar
Asia/Urumqi
Asia/Ust-Nera
Asia/Vientiane
Asia/Vladivostok
Asia/Yakutsk
Asia/Yekaterinburg
Asia/Yerevan
[root@localhost ~]#

To change the Time Zone  ‘Asia/Diliyou use ‘set-timezone’ option with the timedatectl command


[root@localhost ~]# timedatectl set-timezone Asia/Dili
[root@localhost ~]# timedatectl
Local time: Sat 2011-11-12 03:50:43 TLT
Universal time: Fri 2011-11-11 18:50:43 UTC
RTC time: Fri 2011-11-11 18:50:44
       Time zone: Asia/Dili (TLT, +0900)
NTP enabled: no
NTP synchronized: no
RTC in local TZ: no
DST active: n/a
[root@localhost ~]#

Synchronize the System Clock with the Remote Server :


To Synchronizing the System Clock with the Remote Server you use ‘set-ntp’ opton with the timedatectl command.

 [root@localhost ~]# timedatectl set-ntp yes
[root@localhost ~]# timedatectl
Local time: Mon 2016-02-29 04:24:25 TLT
Universal time: Sun 2016-02-28 19:24:25 UTC
RTC time: Sun 2016-02-28 19:24:26
Time zone: Asia/Dili (TLT, +0900)
NTP enabled: yes
NTP synchronized: yes

RTC in local TZ: no
DST active: n/a
[root@localhost ~]#

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s