In this tutorial, I will explain how to configure the time zone called timezone on Ubuntu Server.
Unlike the Desktop version, when installing the server version of Ubuntu, the time zone is not requested, which means that by default, Ubuntu is in the UTC (+0) time zone.
In order to have the logs and scheduled (cron) tasks running at local time, I will explain how to configure the correct time zone using the timedatectl command.
To begin, enter the command if -below to display the date:
date
As we can see in the screenshot below, the server is in the UTC time zone, which means that I have a two hour difference.
To configure the correct time zone, we will use: timedatectl.
To begin, we will display the list of available time zones:
timedatectl list-timezones
This command returns the list of available time zones.
In my case, I will configure the server in the Europe/Paris time zone:
sudo timedatectl set-timezone Europe/Paris
Modify Europe/Paris by the desired time zone.
The order has no return, to check whether it has been taken into account, re-enter the order date.
Now you know how to configure the time zone on your Ubuntu server.