
Change the time zone in Linux using the CLI
It is easy to change the time zone of your Linux server from the command line interface (CLI). The following technique should work on all systemd-derived distros including Redhat, Debian, Ubuntu, Mint, etc.
Check your current time zone
Check your current time zone with the timedatectl
command:
$ timedatectl
Local time: Thu 2023-05-18 07:36:40 GMT
Universal time: Thu 2023-05-18 07:36:40 UTC
RTC time: Thu 2023-05-18 07:36:40
Time zone: GMT (GMT, +0000)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
In this instance, the time zone of the server is GMT.
Set a new time zone
Use the timedatectl
command again with the set-timezone
parameter to set your desired time zone. You will need to use sudo
or a root shell:
sudo timedatectl set-timezone Europe/London
Use the timedatectl
command again to confirm the change:
$ timedatectl
Local time: Thu 2023-05-18 08:36:47 GMT
Universal time: Thu 2023-05-18 07:36:47 UTC
RTC time: Thu 2023-05-18 07:36:47
Time zone: Europe/London (BST, +0100)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
Viewing available time zones
You can use the timedatectl
command with the list-timezones
parameter to list all available time zones:
$ timedatectl list-timezones
This will help you identify the correct time zone for your location. Be warned, it is rather a long list!