Forrest logo
back to the timedatectl tool

timedatectl:tldr:2e10d

timedatectl: Check the current system clock time.
$ timedatectl
try on your machine

The "timedatectl" command is used in Linux-based systems to manage the system's date and time settings. It is a command-line interface to control the systemd timesyncd service, which is responsible for synchronizing the system clock with a remote time server.

When you run the "timedatectl" command, you can view and modify various time and date-related settings, such as the current time, time zone, NTP (Network Time Protocol) status, and more.

Here are some commonly used options with the "timedatectl" command:

  • "timedatectl status": Displays the system's current date, time, time zone, and NTP synchronization status.
  • "timedatectl set-time [time]": Sets the system time to the specified time. The time format should be in the format "HH:MM:SS" (24-hour format).
  • "timedatectl set-timezone [timezone]": Changes the system's time zone to the specified value, such as "America/New_York" or "Asia/Tokyo".
  • "timedatectl set-ntp true": Enables NTP synchronization, allowing the system to automatically adjust the time by syncing it with a remote NTP server.
  • "timedatectl list-timezones": Shows a list of available time zones that can be used with the "set-timezone" option.
  • "timedatectl show": Provides detailed information about the system's time and date settings.

Overall, "timedatectl" offers a convenient way to manage and configure time-related settings on a Linux system through the command line.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the timedatectl tool