Linux Time and Timezone Commands: timedatectl, hwclock and date Explained

timedatectl hwclock timezone - custom-tdc-featured.png

Linux keeps time in more than one place, and the commands that show it are easy to confuse. The system clock is what programs see; the
hardware clock (RTC) keeps time while the machine is off; the timezone only changes how time is displayed. This guide covers each command and when to use it.

For keeping the clock accurate over a network, continue with the chrony NTP guide; if sync fails, see the
troubleshooting checklist.

Understand the Three Concepts

System clock, hardware clock and timezone are separate. Changing the timezone never changes the actual moment in time; it only changes the label.

architectureclocks.txt
  hardware clock (RTC) --boot--> system clock --display--> timezone --> what you read
  NTP (chrony) disciplines the system clock; rtcsync keeps the RTC aligned
System clock, RTC and timezone
Three separate concepts

Read Everything with timedatectl

One command summarises local time, UTC, RTC time, timezone and sync state.

bashstatus
timedatectl
timedatectl show --property=Timezone --property=NTPSynchronized
timedatectl status
Local, UTC, RTC, sync

Set the Timezone

Find the exact name, then set it. Names follow the Region/City pattern.

bashtimezone
timedatectl list-timezones | grep -i kolkata
sudo timedatectl set-timezone Asia/Kolkata
date
Setting the timezone
List, set, verify

Turn On Network Time

set-ntp true enables network time synchronisation through the configured time service. It needs a service to do the work, such as chrony or systemd-timesyncd.

bashenable and check
sudo timedatectl set-ntp true
timedatectl | grep -E 'NTP|synchronized'
NoteIf a full NTP daemon such as chrony is running, its own tools (chronyc tracking) give the authoritative picture.
Enabling NTP
set-ntp and sync check

Set the Time by Hand

Manual time is only accepted while NTP is off, so turn it off, set the time, and turn it back on.

bashmanual set
sudo timedatectl set-ntp false
sudo timedatectl set-time '2026-09-21 14:30:00'
sudo timedatectl set-ntp true
Manual time
Off, set, on

Sync the Hardware Clock with hwclock

hwclock reads and writes the RTC. Use --systohc after fixing the system clock, and --hctosys to load the RTC into the system clock.

bashhwclock
sudo hwclock --show
sudo hwclock --systohc
sudo hwclock --hctosys
hwclock
Read, write, load

Keep the RTC in UTC (Usually)

Linux normally stores UTC in the RTC. Windows expects local time, which causes wrong clocks on dual-boot machines. Choose one convention; UTC is the better default for servers.

bashcheck and set
timedatectl | grep 'RTC in local TZ'
sudo timedatectl set-local-rtc 0
UTC vs local RTC
Pick one convention

Format Dates for Scripts

date formats are the everyday tool for log lines, file names and backups (see our shell scripting guide).

bashexamples
date -u +%Y-%m-%dT%H:%M:%SZ
date +%F_%H%M
date -d 'yesterday' +%F
date -d '2 hours ago' +%T
date formats
UTC, stamps, relative dates

Quick Reference

  • timedatectl to read/set zone and NTP; hwclock --systohc after fixing the clock
  • Keep the RTC in UTC on servers; use date -u in scripts

Related tutorials

Diagrams are original illustrations by Gnome IT Solutions. Tutorial text © Gnome IT Solutions.