How to Change the Time Zone in Ubuntu [5 Best Ways]

Written by

Reviewed by

Last updated: July 24, 2024

Expert verified

SVG Image

TL;DR

Here are the best ways to change the time zone in Ubuntu:

  1. Use the graphical interface, where you have to turn off the Automatic Date & Time feature and select your location on the map or type it into the search bar.
  2. Alternatively, you can use the Linux command line by executing the command timedatectl set-timezone Your_Time_Zone to change the time zone to your desired location.
  3. Another way is to configure NTP settings. Install the NTP package, edit the /etc/ntp.conf file, save changes, and then restart the NTP service.
  4. For the dual boot systems, you need to edit the GRUB config file. Add clocksource=hpet to GRUB_CMDLINE_LINUX_DEFAULT, save changes, update GRUB, and then restart your computer.

Read on to find out more about how to change the time zone in Ubuntu in five easy ways and the best practices to manage it.

Ever had your Ubuntu system display the wrong time and mess up your schedule? There’s a simple fix! In this post, I’ll show you how to change the time zone using straightforward methods. You’ll find step-by-step guides for both the graphical interface and command line, plus tips on configuring NTP and handling dual boot systems. By the end, you’ll know how to keep your system’s time accurate and reliable.

Importance of Accurate Time Settings

Accurate time settings are crucial for several reasons:

  1. Legal and Compliance Requirements: Many industries have strict regulations regarding data accuracy and integrity. Accurate time settings ensure compliance with these standards, which is critical for legal, financial, and medical sectors where precise records are mandatory.
  2. Task Scheduling: Many computer tasks, such as system backups, software updates, and automated scripts, depend on accurate time settings. If the time is incorrect, these tasks might not run as planned, leading to potential data loss or system issues.
  3. Communication and Collaboration: Accurate time settings ensure emails, calendar events, and messages are correctly timestamped. This synchronization is vital for coordinating meetings and deadlines, especially in different time zones, to avoid confusion and missed appointments.
  4. Security Protocols: Many security measures rely on precise time settings. Time-based authentication methods, log entries, and encryption protocols require accurate timestamps. An incorrect time can create security vulnerabilities and make it challenging to trace security incidents.
  5. File Management: Accurate timestamps help organize and manage files effectively. Files are saved and sorted by the correct date and time, making finding and tracking changes easier. This is especially important for version control and document management systems.
  6. Network Coordination: In networked environments, all devices need synchronized time settings to function smoothly. Accurate time ensures proper coordination between servers, clients, and network devices. It prevents data mismatches, reduces errors, and ensures reliable data transfers.

How to Change the Time Zone in Ubuntu

To change the time zone in Ubuntu, you can either use the graphical interface or the command line. For the graphical method, go to Settings > Date & Time, turn off “Automatic Date & Time,” and select your time zone from the map. For the command line, open the Terminal and use sudo timedatectl set-timezone Your_Time_Zone, replacing Your_Time_Zone with your desired time zone.

Here is the detailed guide with step-by-step instructions for the above two methods and three methods to change timezone in Ubuntu:

1. Graphical Interface

The GUI time zone settings are found in the main settings menu of your Ubuntu system, which can be easily accessed by clicking on the gear icon. Here’s how you can navigate to it and change the time zone in Ubuntu:

  1. Click on the top right corner of your screen and select Settings.
click on top right corner of screen and select settings
  1. Scroll down and select Date & Time in the left pane. Turn off Automatic Date & Time and then click Time Zone.
turn off automatic date time and then click  change the time zone
  1. Click on the map to select your location and close the window. Alternatively, you can type and search for your location at the top.
click on map to select your location
  1. Once you’ve changed the change the time zone settings, close the map window to save changes.

2. Command Line

If you prefer to use the command line interface to change the time zone in Ubuntu, the process is straightforward and can be done in just a few steps using the timedatectl command in the Terminal app. Here’s how you can do this:

  1. Open the Terminal window, and time the following command to check your current timezone:
timedatectl
  1. Type the following command, replacing Your_Time_Zone with your desired time zone:
sudo timedatectl set-timezone Your_Time_Zone
  1. Enter your administrative password if prompted.
  1. Then, run the following command to check if the changes applied were successful.
timedatectl
  1. Once you execute the command, you’ll see the following output:
run following command to check if change the time zone applied

You can use the timedatectl list-timezones to see if your time zone is available in the list. However, you can also look into the list of available time zones on Ubuntu’s official man page.

3. Configure NTP

NTP (Network Time Protocol) is a protocol used to synchronize the time of a computer with a reference time source. Ubuntu uses NTP to synchronize the system clock with remote servers. Here’s how to configure NTP settings in Ubuntu:

  1. Open a terminal window, and type the following command to install the NTP package:
sudo apt-get install ntp
  1. Enter your administrative password if prompted.
  2. Once the installation is complete, open the NTP configuration file by typing the following command:
sudo nano /etc/ntp.conf
  1. Edit the NTP servers section to add the NTP servers you want to use. Here’s an example:
server 0.pool.ntp.org  
server 1.pool.ntp.org 
server 2.pool.ntp.org
  1. Save the changes by pressing Ctrl + O and then Ctrl + X to exit Nano.
  2. Restart the NTP service by typing the following command:
sudo service ntp restart

4. Dual Boot Systems

If you’re running a dual boot system with both Windows and Ubuntu installed, you may run into issues with time zone settings. This is because Windows and Ubuntu handle time zone settings differently, which can cause conflicts when you switch between operating systems. To avoid these conflicts, you’ll need to configure time zone settings differently on your Ubuntu system. Here’s how to do it:

  1. In the Terminal window, execute the following command to edit the GRUB configuration file:
sudo nano /etc/default/grub
  1. Look for the line that begins with GRUB_CMDLINE_LINUX_DEFAULT and add the following to the end of the line:
clocksource=hpet
  1. Now, the line should look like this:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash clocksource=hpet"
  1. Save the changes by pressing Ctrl + O and then Ctrl + X to exit the nano editor.
  2. Update GRUB by typing the following command:
sudo update-grub
  1. Use the sudo reboot command to restart your Linux system.

5. Adjust DST

DST (Daylight Saving Time) is a system used to adjust the clock for more daylight during certain periods of the year. Enabling automatic DST adjustments on your Ubuntu system can help ensure that your system clock stays accurate and reflects the correct time during DST periods. Here’s how to enable automatic DST adjustments using the timedatectl command:

  1. Execute the command below to verify that the system clock is using UTC:
 timedatectl
  1. Use the timedatectl command to enable automatic DST adjustments:
sudo timedatectl set-ntp true
sudo timedatectl set-local-rtc 1
  1. Now, restart your system with the sudo reboot command to apply the changes.

5 Quick Tips to Manage the Time Zone in Ubuntu

Managing time zones in Ubuntu is important to ensure that your system clock displays the correct time and that time-sensitive operations are performed accurately. Here are five quick tips to help you manage the time zone in Ubuntu more effectively:

  • Check the System Clock Regularly: Regularly check your system clock to ensure it shows the correct time. Use the time and date settings in the system tray or run timedatectl in the Terminal. Frequent checks help you spot and fix time-related issues quickly.
  • 🌐 Set the Correct Time Zone: Set the correct time zone to ensure your system displays the right time. You can do this via the graphical interface or the command line. For the command line, use sudo timedatectl set-timezone YOUR_TIME_ZONE.
  • 📋 Monitor System Logs: Monitor system logs to identify and resolve issues quickly. This is crucial for time-sensitive server applications, like cron jobs sending daily notifications. Regular log checks ensure smooth and effective operations.
  • Test System Clock Accuracy: Test your system clock’s accuracy regularly using tools like ntpstat or timedatectl. This helps you identify and correct any inaccuracies promptly.
  • 🔄 Keep Your Ubuntu System Up to Date: Keep your system updated with the latest security patches and software updates. These updates often include important time zone updates. Use sudo apt update and sudo apt upgrade to keep your system current.

Wrapping up

In the article, I showed you how to change the time zone in Ubuntu using both the graphical interface and the command line. I also explained how to configure NTP settings to keep your system clock synchronized with remote servers, ensuring your system always shows the correct time.

For more in-depth learning, I recommend checking out related articles:

Frequently Asked Questions

What should I do if my desired time zone is not available on the list?

If your desired time zone is not available on the list in Ubuntu, you can install the missing time zone by installing the tzdata package. To install it, open the Terminal and enter the sudo apt-get install tzdata command. This will download and install the latest version of the tzdata package, which contains time zone information for various regions around the world. After the installation is complete, you can update the time zone settings for your system or for individual users using the command line or graphical interface.

How do I check my current time zone in Ubuntu?

The easiest way to check your current time zone in Ubuntu is to use the command line tool called timedatectl. Here’s how to use it:
1. Pressing Ctrl + Alt + T on your keyboard.
2. Look for the line that says “Time zone” to see the name of your current time zone.
3. If you want to see a list of all available time zones, type the following command: timedatectl list-timezones
4. To set your time zone, use the following command:
sudo timedatectl set-timezone
Replace <time zone> with the name of your time zone, such as “America/New_York”.
5. Once you’ve set your time zone, your system clock will automatically adjust to the correct time for your location.

Why are my time zone settings not working?

Time zone settings may not work due to incorrect time zone selection, outdated system, incorrect hardware clock settings, incorrect network time synchronization, or file system corruption. Check time zone, update system, verify hardware clock and network synchronization, and repair file system errors using relevant commands. If problems persist, seek assistance from the Ubuntu community or professional support service.

Can I change the time zone automatically based on my location?

Yes, you can change the time zone automatically based on your location by using Ubuntu’s Automatic Time Zone feature. Enable this option in the Settings app, and Ubuntu will detect your location via an internet connection and set the correct time zone. However, it may not work with a VPN or hidden location. In that case, you’ll have to set the time zone manually.

Why is setting the accurate time zone important?

Setting the accurate time zone is important because it prevents scheduling and synchronization issues, impacts system security, and improves performance. Incorrect settings can cause problems with email, database transactions, SSL/TLS certificates, and background tasks such as backups and updates.

Can I change the time zone settings for individual users on Ubuntu?

Yes, you can change the time zone settings for individual users by using the command line. Here are the two ways to do it:
Command line: Execute the sudo timedatectl set-timezone Your_Time_Zone --user=username in the Terminal window.
– Graphical Interface: Navigate to user accounts in system settings, select user, choose Time & Date, and set desired time zone. Ensure correct settings for each user to avoid errors.

How do I configure automatic time synchronization on Ubuntu?

Ubuntu has NTP (Network Time Protocol) enabled by default, automatically synchronizing the system clock with remote NTP servers. If you want to configure automatic time synchronization settings, you can use the timedatectl command to enable or disable automatic time synchronization. For example, use the command: sudo timedatectl set-ntp true to enable automatic time synchronization.

Ojash

Author

Ojash is a skilled Linux expert and tech writer with over a decade of experience. He has extensive knowledge of Linux's file system, command-line interface, and software installations. Ojash is also an expert in shell scripting and automation, with experience in Bash, Python, and Perl. He has published numerous articles on Linux in various online publications, making him a valuable resource for both seasoned Linux users and beginners. Ojash is also an active member of the Linux community and participates in Linux forums.

Akshat

Reviewer

Akshat is a software engineer, product designer and the co-founder of Scrutify. He's an experienced Linux professional and the senior editor of this blog. He is also an open-source contributor to many projects on Github and has written several technical guides on Linux. Apart from that, he’s also actively sharing his ideas and tutorials on Medium and Attirer. As the editor of this blog, Akshat brings his wealth of knowledge and experience to provide readers with valuable insights and advice on a wide range of Linux-related topics.

Share this article
Shareable URL
Next Post

3 Best Ways to Prettify JSON in Linux

Leave a Reply

Your email address will not be published. Required fields are marked *

Read next