Skip to main content

Setting Up Timezone and NTP on Ubuntu

·
linux System Administration Time Synchronization timezone ntp timedatectl systemd Linux server setup
Table of Contents

⏰ Introduction
#

Setting the correct timezone on your system ensures that dates and times are displayed accurately. This guide will walk you through the steps to change the timezone to Europe/London.


🛠️ Check Timezone
#

timedatectl status

⚙️ Setting Timezone
#

To set the timezone, run one of the following commands:

sudo timedatectl set-timezone Europe/London

Or use dpkg-reconfigure for a menu-driven option:

sudo dpkg-reconfigure tzdata

🛠️ Verifying Timezone Change
#

After setting the timezone, verify that it has taken effect by running:

timedatectl status

The output should indicate that the timezone is set to Europe/London.


NTP Time Configuration
#

To enable NTP you need to run the command

timedatectl set-ntp true

You also need to edit your /etc/systemd/timesyncd.conf:

sudo nano /etc/systemd/timesyncd.conf

Then add

[Time]
NTP=0.pool.ntp.org 1.pool.ntp.org 2.pool.ntp.org 3.pool.ntp.org

📝 Example Output
#

Here’s an example of what you might see in the timedatectl status output:

Local time: Wed 2025-03-12 21:24:32 GMT
Universal time: Wed 2025-03-12 21:24:32 UTC
RTC time: Wed 2025-03-12 21:24:32
Time zone: Europe/London (GMT, +0000)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no

If everything is working correctly, the timezone should be set to Europe/London.


🔑 Conclusion
#

You have successfully changed your system’s timezone to Europe/London and configured NTP time. Remember to test that dates and times are displayed accurately after making this change.