> ## Documentation Index
> Fetch the complete documentation index at: https://help.freakhosting.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Set the Time Zone on Ubuntu with timedatectl

> Set the time zone on Ubuntu, Debian or AlmaLinux with sudo timedatectl set-timezone Europe/London, then check NTP time sync with timedatectl or chronyc.

To set the time zone on Ubuntu, run `sudo timedatectl set-timezone Europe/London` (find the exact name with `timedatectl list-timezones`). The change applies straight away, without a reboot. Run `timedatectl` to check: it shows the new **Time zone** and `System clock synchronized: yes` when NTP time sync works. The same commands work on Debian, AlmaLinux and Rocky Linux.

| Difficulty | Time | Works on | Needs |
| - | - | - | - |
| Beginner | 5 minutes | Ubuntu 22.04 / 24.04, Debian 12 / 13, AlmaLinux / Rocky 9 / 10 | sudo or root access |

## Before you start

* [Connect with SSH](https://help.freakhosting.com/portals/other/how-to-connect-to-a-linux-server-with-ssh.md) as a [sudo user](https://help.freakhosting.com/portals/other/how-to-create-a-sudo-user-on-linux.md). Root can leave out `sudo`.
* Many servers run in **UTC** on purpose: logs from different servers line up and there are no daylight-saving jumps. Change the zone if your cron jobs, apps or logs should follow local time.

## How to check the current time zone

```bash theme={null}
timedatectl
```

Example output:

```text theme={null}
               Local time: Wed 2026-11-04 10:30:12 UTC
           Universal time: Wed 2026-11-04 10:30:12 UTC
                 RTC time: Wed 2026-11-04 10:30:12
                Time zone: Etc/UTC (UTC, +0000)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no
```

## How to set the time zone

**1. Find your time zone name**

Names use the `Region/City` format.

```bash theme={null}
timedatectl list-timezones | grep -i london
```

```text theme={null}
Europe/London
```

**2. Set it**

```bash theme={null}
sudo timedatectl set-timezone Europe/London
```

**3. Check it**

```bash theme={null}
timedatectl | grep "Time zone"
date
```

```text theme={null}
                Time zone: Europe/London (GMT, +0000)
Wed  4 Nov 10:31:40 GMT 2026
```

To go back to UTC: `sudo timedatectl set-timezone UTC`.

> [!NOTE]
>
> Programs that are already running may keep the old zone until they restart, for example `cron`, PHP-FPM, MySQL/MariaDB and Java apps. Restart them with `sudo systemctl restart <service>` or reboot in a quiet period. PHP and MySQL also have their own time zone settings (`date.timezone` in `php.ini`, `default-time-zone` in MySQL).

## How to turn on automatic time sync (NTP)

**NTP** (Network Time Protocol) keeps the clock correct by comparing it with time servers on the internet. A wrong clock breaks SSL certificates, two-factor codes and log timelines.

> [tab] Ubuntu / Debian
>
> Ubuntu 24.04 and earlier use `systemd-timesyncd` by default. (Ubuntu 25.10 and later use `chrony`.)
>
> ```bash theme={null}
> sudo timedatectl set-ntp true
> timedatectl timesync-status
> ```
>
> If `NTP service` shows `n/a`, no time sync service is installed. Install one:
>
> ```bash theme={null}
> sudo apt install systemd-timesyncd
> ```
>
> To use other time servers, create `/etc/systemd/timesyncd.conf.d/ntp.conf`:
>
> ```ini theme={null}
> [Time]
> NTP=0.pool.ntp.org 1.pool.ntp.org
> ```
>
> Then restart it: `sudo systemctl restart systemd-timesyncd`.

> [tab] AlmaLinux / Rocky
>
> AlmaLinux and Rocky Linux use `chrony` (service `chronyd`), installed by default.
>
> ```bash theme={null}
> sudo systemctl enable --now chronyd
> chronyc tracking
> chronyc sources
> ```
>
> Time servers are set in `/etc/chrony.conf` (`pool` or `server` lines). After a change, run `sudo systemctl restart chronyd`.

> [!NOTE]
>
> Run only one time sync service. If you install `chrony` on Ubuntu or Debian, it replaces `systemd-timesyncd`.

## How to check it worked

```bash theme={null}
timedatectl
```

You should see your chosen **Time zone**, `System clock synchronized: yes` and `NTP service: active`. On AlmaLinux/Rocky, `chronyc tracking` shows `Leap status : Normal` and a small `System time` offset (for example a few microseconds).

Right after you enable NTP, `synchronized` can show `no` for a minute while the first time servers answer.

## Frequently asked questions

### How do I change the time zone without timedatectl?

Point `/etc/localtime` at the zone file: `sudo ln -sf /usr/share/zoneinfo/Europe/London /etc/localtime`. On Ubuntu and Debian you can also run `sudo dpkg-reconfigure tzdata` and pick from a menu.

### Why is my server clock wrong after a reboot?

NTP is off or blocked. Check `timedatectl`, enable NTP as above, and make sure outgoing UDP port 123 isn't blocked by your own firewall.

### Can I set the time by hand?

Only with NTP off: `sudo timedatectl set-ntp false` then `sudo timedatectl set-time "2026-11-04 10:45:00"`. Turn NTP back on afterwards; a manual clock drifts.

### Does the time zone affect cron jobs?

Yes. cron runs jobs in the server's local time. See [schedule tasks with cron](https://help.freakhosting.com/portals/other/how-to-schedule-tasks-with-cron.md).

## Related guides

> [card] [VPS and dedicated server guides](https://help.freakhosting.com/portals/other/vps-and-dedicated-server-guides.md)
>
> Every server guide in one place.

> [card] [Schedule tasks with cron](https://help.freakhosting.com/portals/other/how-to-schedule-tasks-with-cron.md)
>
> Run jobs at the right local time.

> [card] [Change the hostname](https://help.freakhosting.com/portals/other/how-to-change-the-hostname-on-linux.md)
>
> Another first-day setting.

> [card] [First 10 things on a new VPS](https://help.freakhosting.com/portals/other/first-10-things-to-do-on-a-new-linux-vps.md)
>
> Set up a new server properly.

***

> [!NOTE]
>
> **Checked against the official [Ubuntu Server documentation on timedatectl and timesyncd](https://documentation.ubuntu.com/server/how-to/networking/timedatectl-and-timesyncd/), the [timedatectl manual](https://www.freedesktop.org/software/systemd/man/latest/timedatectl.html) and the [Red Hat Enterprise Linux 9 time synchronization guide](https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html/configuring_basic_system_settings/configuring-time-synchronization_configuring-basic-system-settings)** on 4 November 2026. Our test container doesn't run systemd, so these commands were not run there. Commands can differ on other distributions or releases.

> [!NOTE]
>
> ### Need Extra Help?
>
> If you encounter any issues, our support team is ready to assist:
>
> * **Live Chat:** Quick assistance via our website.
> * **Support Ticket:** [Open a Ticket](https://freakhosting.com/clientarea/submitticket.php)
> * **Discord:** [Join our Community](https://discord.gg/freakhosting)
> * **Email:** [support@freakhosting.com](mailto:support@freakhosting.com)

> [!TIP]
>
> ### Save on Your Hosting
>
> Ready to upgrade your hosting? Use code **KB20** at checkout for **20% off** your first order!

***

**Last Updated:** November 2026


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.