![change timezone linux change timezone linux](https://qwer.linuxfordevices.com/wp-content/uploads/2020/03/GUI-step-1.png)
On an Ubuntu 18.04 server I also had to restart systemd-timesyncd (but this was no needed on my Ubuntu 19.04 or Solus OS systems for example), or else the system time would not get synchronized. If using a service like chrony or ntpd to make changes, these are not shown by timedatectl until systemd-timedated is restarted:
![change timezone linux change timezone linux](https://operavps.com/wp-content/uploads/2020/06/Seti-time-in-Linux.png)
timesyncd should be installed by default in many cases though (for example it's installed by default with Ubuntu 16.04 and newer). It's worth noting that this command fails if a NTP service is not installed, e.g. If you want to disable it, just use false instead of true. Start by using timedatectl to find if the network time synchronization (NTP) service is active and your system clock synchronized:Įnable the NTP service on your Linux system with the command:
#Change timezone linux how to
How to synchronize the system clock with a remote server (enable NTP) using timedatectl Using the same example, to set the timezone to America/Los_Angeles, /etc/localtime needs to be a symbolic link to /usr/share/zoneinfo/America/Los_Angeles. You may also create this link manually and achieve the same thing. This command creates a symbolic link for the time zone you choose from /usr/share/zoneinfo/ to /etc/localtime. Timedatectl set-timezone America/Los_Angeles For example, set your Linux system timezone to America/Lost_Angeles with: Where is a timezone listed by timedatectl list-timezones.
![change timezone linux change timezone linux](https://itslinuxfoss.com/wp-content/uploads/2021/03/4-4.png)
Now set the timezone on your Linux system using the command: You can filter it to only show time zones for a continent or the capital city of a country/state, by using grep, e.g. Now let's list all the available time zones, so you know the exact name of the time zone you'll use on your system (needed for the command that changes the time zone): How to Change timezone on Linux using timedatectlīefore changing your time zone, start by using timedatectl to find out the currently set time zone (also shows other information about the system time settings): Timedatectl is a command line utility available as part of systemd that allows changing various settings of your system clock. This article explains how to use timedatectl to change the timezone and enable automatic synchronization of the system clock with a remote server using the NTP (Network Time Protocol) on Linux.