Skip to content

How to Set the Date, Time, Time Zone and NTP with timedatectl

Updated 2 min read

Updated: 28 September 2026 · Applies to: systemd 252 to 259 (timedatectl) on AlmaLinux and Rocky Linux 9 and 10, RHEL 9 and 10, Ubuntu 24.04 and 26.04, Debian 13

timedatectl shows and sets the system clock, the time zone and automatic time synchronisation (NTP) in one tool. It replaces the separate date, hwclock and /etc/localtime steps of older guides.

1. See the current settings

timedatectl

The output shows local time, UTC, the real-time clock (RTC), the time zone, whether the clock is synchronised, and whether the NTP service is active.

2. Set the time zone

  1. Find the name of your zone:
    timedatectl list-timezones | grep -i kolkata
  2. Set it:
    timedatectl set-timezone Asia/Kolkata

Servers are often left on UTC, which avoids daylight-saving jumps in logs and cron jobs. Choose one policy for all your servers.

3. Keep the time right automatically (NTP)

timedatectl set-ntp true

This switches on the installed time service: chrony on AlmaLinux, Rocky Linux, RHEL and Ubuntu 26.04, systemd-timesyncd on Ubuntu 24.04 and Debian 13. Check with timedatectl: System clock synchronized: yes. If "NTP service" shows n/a, no time service is installed; see how to synchronize time with NTP on Linux.

4. Set the date and time by hand

Only needed on a server without network time. Switch NTP off first, or it rejects the change:

timedatectl set-ntp false
timedatectl set-time "2026-09-28 14:30:00"
timedatectl set-time 14:30:00          # time only

5. The hardware clock (RTC)

Linux servers should keep the hardware clock in UTC. timedatectl warns if it is set to local time. To switch it back to UTC:

timedatectl set-local-rtc 0

Only dual-boot machines with Windows sometimes need local time in the RTC.

Common problems

  • "Failed to set time: Automatic time synchronization is enabled": run timedatectl set-ntp false first, as in step 4.
  • Cron jobs run an hour off after a zone change: restart cron (systemctl restart crond on AlmaLinux, Rocky Linux and RHEL, systemctl restart cron on Ubuntu and Debian) and any service that caches the zone.
  • In a container: the clock belongs to the host; only the time zone can be set inside the container.

Official documentation: timedatectl.

Related services

KVM VPS hosting

NVMe SSD and full root access, with Free Basic Managed Support.

Unmanaged dedicated servers

full root access and free IPMI KVM, with Free Basic Managed Support.

Linux server management

hardening, patching, monitoring and automation for Ubuntu, Debian, RHEL and AlmaLinux.

Was this answer helpful?

Still stuck? Open a ticket