Timedatectl is a free time management command-line tool for Linux. Using timedatectl command, you can control the system time and date and learn time management easily in your Linux system. It allows you to set your time, timezone, date and more in your system.
How to Use the timedatectl Command
Open your terminal application (ctrl+alt+t) and run below command to check your current time local time, universal time, real time clock time, time zone, NTP service status, clock synchronized and with some other values.
timedatectl
[OR]
timedatectl status
To get the total number of Time zones run below command.
timedatectl list-timezones | wc -l
How to Set Time using timedatectl:
If you want to change the current time and then use below command. Replace “11:15:00” with your current time.
timedatectl set-time 11:15:00
For data and time then use like below
timedatectl set-time "2024-04-04 11:15:00"
How to Set TimeZone using timedatectl:
If you want to set “Asia/Kolkata” timezone in your system then run below command.
timedatectl set-timezone "Asia/Kolkata"
Start and Stop Time synchronization service:
Run below command to start time synchronization service.
sudo systemctl start systemd-timesyncd.service
And you can stop it using below command.
sudo systemctl stop systemd-timesyncd.service
For details run below command.
man timedatectl