How to Configure Timezone Settings on Ubuntu

In this guide, we’ll walk you through the step-by-step process of setting the timezone on Ubuntu to manage your Linux Virtual Private Server (VPS) effectively. Ensure you log in as a root user to perform the following actions.

Using the Graphical User Interface (GUI):

The most user-friendly way to adjust the timezone on an Ubuntu system is through the graphical user interface (GUI). This method doesn’t require command-line operations and is accessible directly from the desktop. The steps below apply to Ubuntu 18.04, Ubuntu 20.04, and Ubuntu 22.04:

  1. Click on the System menu at the top-right corner of the screen.
  2. Select Settings and navigate to the Date & Time tab.
  3. Turn off the Automatic Time Zone option to prevent automatic adjustments based on internet connection.
  4. Click on Time Zone, and a new window will open. Choose the desired timezone by clicking on the map or using the search bar.
  5. Close the window by clicking the ‘x’ button.
  6. Verify the changes by checking the Time Zone box inside the Date & Time tab.

Using timedatectl (via the Command Line):

For a more permanent solution via the command line, you can use the timedatectl command. This utility allows users to review and modify the system clock configuration. Follow these steps:

  1. Open your command-line interface (CLI) and check the current system timezone with the command `timedatectl`.
  2. Find the full name of the timezone by running `timedatectl list-timezones` or by combining it with grep for a specific city.
  3. Use the command `sudo timedatectl set-timezone [timezone]` to change the timezone.
  4. Verify the update by running `timedatectl`.

 

Using the tzdata Command (Older Ubuntu Versions):

For users on Ubuntu versions 16.04 or lower, the tzdata command is an alternative. This command involves reconfiguring the timezone and daylight-saving time data. Here’s how to do it:

  1. Run the command `sudo dpkg-reconfigure tzdata` to reconfigure the timezone.
  2. Choose your geographic area and city or region accordingly.
  3. Verify the update by checking the output, ensuring the current timezone is set correctly.