How to Change the Timezone on a Linux VPS

Linux VPS
Timezone configuration is a critical aspect of any server setup, ensuring accurate time representation and synchronization across various applications and services. Whether you’re managing a Virtual Private Server (VPS) or a Dedicated Server, knowing how to change the timezone is a fundamental skill for every system administrator and server owner.
In this guide, we’ll provide simple step-by-step instructions, empowering you to synchronize time accurately and streamline server management. Get ready to wield complete control over your server’s time settings like a pro. Let’s begin!
 

In order to change the current timezone on your VPS or Dedicated Server connect to your server as root via SSH

To check the current date, time and timezone use the following command:

date
On my server the output is the following:
Mon 7 Aug 2023 04:00:00 AM CEST  

As you can see, the current timezone is Central European Summer Time.

To configure a different timezone use the following command:

timedatectl set-timezone [new/time_zone]
The available time zones can be found in /usr/share/zoneinfo/
 
 
If you go into the “Europe” folder and execute “ls” you will see ever city that is available to choose from:
 
 
In our example we will set the timezone to Europe and Berlin. To do so, execute the following command:
root@server1:~# timedatectl set-timezone Europe/London
After the timezone has been changes, the output of the “date” command will be the following:
Wed 11 Sep 2019 09:14:07 AM BST