How To

Change Timezone on Ubuntu 18.04: Command Line and GUI Methods

Setting the correct timezone on your Ubuntu machine is more important than it sounds. Your system clock affects more than just the time displayed in the terminal. Cron jobs rely on the system timezone to decide when to run. Log file timestamps are recorded using the same timezone. If it is wrong, your logs will be hard to read and scheduled tasks may fire at the wrong time.

This guide shows you how to change timezone on Ubuntu 18.04 using the command line and the graphical interface. The same steps apply to Ubuntu 16.04 and other Ubuntu-based distributions.

Prerequisite: You need sudo access to change the system timezone.

Check the Current Timezone

Before making changes, confirm what timezone your system is currently using.

Run the timedatectl command:

bashtimedatectl

Look for the Time zone line in the output. On a fresh Ubuntu install, this is usually set to Etc/UTC.

The system timezone is stored as a symlink from /etc/localtime pointing to a timezone file inside /usr/share/zoneinfo/. You can check the active link directly:

bashls -l /etc/localtime

Or read the stored timezone name from a plain text file:

bashcat /etc/timezone

Change Timezone on Ubuntu Using timedatectl

The timedatectl command is the standard tool for managing time settings on Ubuntu 18.04. Timezone names follow a Region/City format. Common examples include America/New_YorkAsia/Kolkata, and Europe/London.

List all available timezones:

bashtimedatectl list-timezones

The list is long. Pipe it through grep to narrow down your search by region:

bashtimedatectl list-timezones | grep Europe

Set your chosen timezone:

bashsudo timedatectl set-timezone Europe/Rome

Verify the change:

bashtimedatectl

The Time zone line in the output will show the new timezone and its UTC offset.

Change Timezone Using the tzdata Package

On older Ubuntu versions where timedatectl is not available, update the timezone using the tzdata package instead.

Write the new timezone name to the /etc/timezone file:

bashecho "Europe/Rome" | sudo tee /etc/timezone

Apply the change by reconfiguring the package:

bashsudo dpkg-reconfigure --frontend noninteractive tzdata

The output will confirm the new local time and UTC offset.

Change Timezone from the Desktop GUI

If you prefer not to use the terminal, you can update the timezone from the Ubuntu desktop settings.

Open the Settings application. Click the Date and Time tab. Switch Automatic Time Zone to Off, then click the Time Zone field.

A map will open. Click your location on the map, or type a city name into the search bar. The timezone updates right away once you make a selection.

If Automatic Time Zone is turned on and your machine has an internet connection, Ubuntu will try to detect the timezone from your location automatically.

Your Ubuntu 18.04 system now runs on the correct timezone. The change takes effect immediately and applies to cron schedules, log timestamps, and all running services. No reboot is required. Leave a comment below if you have any questions.

Cyber Defence

Recent Posts

Install Tomcat 9 on Ubuntu 18.04: Systemd Service Setup Guide

Apache Tomcat is an open-source Java application server that implements the Java Servlet, JavaServer Pages, and…

3 minutes ago

Install PrestaShop on Ubuntu 18.04 with Nginx and MySQL

PrestaShop is a free, open-source e-commerce platform built with PHP and MySQL. It comes with a…

21 minutes ago

Set Up SSH Keys on Ubuntu 18.04: Passwordless Login Guide

SSH keys give you a more secure and convenient way to connect to remote servers. Instead…

27 minutes ago

Install FFmpeg on Ubuntu 18.04: apt, Snap, and Usage Examples

FFmpeg is a free, open-source command-line tool for working with multimedia files. It can convert video…

30 minutes ago

Set Up Nginx Server Blocks on Ubuntu 18.04: Host Multiple Sites

Nginx server blocks let you run more than one website on a single server. Each block…

23 hours ago

Install Tor Browser on Ubuntu 18.04: Anonymous Browsing Guide

Tor Browser is a modified version of Firefox that routes all your web traffic through the Tor…

23 hours ago