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.
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
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_York, Asia/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.
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.
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.