Skip to content

How to Check and Change the Timezone on Debian and Ubuntu (timedatectl and tzdata)

Updated 6 min read

Updated: 8 October 2026 · Applies to: Debian 13 (systemd 257), Ubuntu 24.04 (systemd 255) and Ubuntu 26.04 (systemd 259) with tzdata 2026c; AlmaLinux 10 noted

To check the timezone on Debian or Ubuntu, run timedatectl and look at the Time zone line. To change it, run sudo timedatectl set-timezone with a name from timedatectl list-timezones, for example Asia/Kolkata. The change is immediate and needs no reboot.

timedatectl
timedatectl list-timezones | grep -i kolkata
sudo timedatectl set-timezone Asia/Kolkata

Check the current timezone

$ timedatectl
               Local time: Thu 2026-10-08 10:53:13 IST
           Universal time: Thu 2026-10-08 05:23:13 UTC
                 RTC time: n/a
                Time zone: Asia/Kolkata (IST, +0530)
System clock synchronized: yes
              NTP service: inactive
          RTC in local TZ: no

Time zone shows the zone name, its abbreviation and the offset from UTC. We ran this in a test container, which has no hardware clock or time sync service of its own, so RTC time shows n/a and NTP service inactive; for keeping the clock correct, see how to synchronise time with NTP. Other ways to check, handy in scripts:

$ timedatectl show -p Timezone --value
Asia/Kolkata
$ date '+%Z %z'
IST +0530
$ ls -l /etc/localtime
lrwxrwxrwx 1 root root 34 Oct  8 10:53 /etc/localtime -> ../usr/share/zoneinfo/Asia/Kolkata

The system timezone is the file /etc/localtime, a symbolic link into /usr/share/zoneinfo.

Change the timezone with timedatectl

  1. Find the exact name. Names are Region/City and case-sensitive:
    $ timedatectl list-timezones | grep -i kolkata
    Asia/Kolkata
    For UTC, which many servers use so that logs from different machines line up, the name is Etc/UTC or UTC.
  2. Set it (no output means success):
    sudo timedatectl set-timezone Asia/Kolkata
    According to the timedatectl manual, this changes the /etc/localtime link. A wrong name is refused:
    Failed to set time zone: Invalid or not installed time zone 'Asia/Kolkatta'
  3. Check the result with timedatectl or date:
    $ date
    Thu Oct  8 10:53:13 IST 2026
  4. Restart services that read the timezone only when they start (see "What changes with the timezone" below).

Old names such as Asia/Calcutta or US/Eastern

On Debian 13, Ubuntu 24.04 and Ubuntu 26.04, older names are not installed by default and give the same "Invalid or not installed time zone" error. They are in the tzdata-legacy package. Use the current name instead (Asia/Kolkata, America/New_York), or install the package if an application insists on the old one: after sudo apt install tzdata-legacy, timedatectl set-timezone Asia/Calcutta worked. AlmaLinux 10 accepts these names without extra packages.

Change it without timedatectl (dpkg-reconfigure tzdata)

Where systemd is not running, for example in a Docker container or a chroot, use the tzdata package. sudo dpkg-reconfigure tzdata asks for the Geographic area and then the Time zone in two menus. For a script or Dockerfile, set the link yourself and let tzdata confirm it:

$ sudo ln -sf /usr/share/zoneinfo/Europe/London /etc/localtime
$ sudo dpkg-reconfigure -f noninteractive tzdata

Current default time zone: 'Europe/London'
Local time is now:      Thu Oct  8 06:23:19 BST 2026.
Universal Time is now:  Thu Oct  8 05:23:19 UTC 2026.

Ubuntu container images do not include tzdata at all; install it with apt install tzdata first. On a normal server, prefer timedatectl: after a manual ln -sf, timedatectl kept showing the old zone in our test until its background service (systemd-timedated) had stopped, within 40 seconds.

Do not rely on /etc/timezone

Older guides read or edit /etc/timezone. On Debian 13 and Ubuntu 26.04 the file does not exist. Ubuntu 24.04 still has it, but timedatectl set-timezone does not update it: after switching to Asia/Kolkata it still said Etc/UTC. dpkg-reconfigure also ignores it and follows /etc/localtime. Read the zone with timedatectl instead. If an old application on Ubuntu 24.04 still reads /etc/timezone, run sudo dpkg-reconfigure -f noninteractive tzdata after the change; it rewrote the file to match.

Use another timezone for one command or one user

The TZ variable overrides the system zone for a single command, and export TZ=Europe/London in a user's ~/.bashrc does it for that user's shell:

$ TZ=America/New_York date
Thu Oct  8 01:23:13 EDT 2026

What changes with the timezone

  • Running programs. Many pick up the new zone by themselves: a bash loop that was already running switched from UTC to IST in our test. Programs that read the zone only at start keep the old one until restarted.
  • cron. No restart is needed. On Debian 13 and Ubuntu 26.04 we changed the zone from UTC to Asia/Kolkata while cron was running, and a job set for 56 10 * * * ran at 10:56 IST. Every job follows the new local time, so check jobs that must run at a fixed UTC time. According to the cron manual, cron handles only one timezone for all jobs. For a job in another zone, use a systemd timer and put the zone at the end of OnCalendar:
    $ systemd-analyze calendar '*-*-* 09:00 Asia/Kolkata' | head -4
      Original form: *-*-* 09:00 Asia/Kolkata
    Normalized form: *-*-* 09:00:00 Asia/Kolkata
        Next elapse: Fri 2026-10-09 03:30:00 UTC
           From now: 22h left
    For crontab syntax, see how to list cron jobs and read crontab syntax.
  • Logs. journalctl shows times in the current zone, older entries included; journalctl --utc shows UTC. Text log files keep the times they were written with, so they jump at the moment of the change. See journalctl examples.
  • PHP. PHP does not use the system zone. With the system set to Asia/Kolkata, PHP 8.3 still reported UTC until date.timezone was set. See set the default timezone in PHP, or change the PHP timezone in cPanel.
  • MySQL and MariaDB. According to their documentation, both servers read the system timezone when they start (the system_time_zone variable), and MySQL advises a restart after the system zone changes. Restart the database service after the change.
  • Hardware clock. Keep it in UTC (RTC in local TZ: no). The timedatectl manual warns that a hardware clock in local time causes problems with timezone and daylight saving changes; sudo timedatectl set-local-rtc 0 sets UTC.

AlmaLinux and Rocky Linux

These systems use the same timedatectl commands. On AlmaLinux 10 there is no dpkg-reconfigure and no /etc/timezone, and old names such as US/Eastern worked without extra packages. For date, time and NTP settings in one place, see set the date, time, timezone and NTP with 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