

If your Linux distribution has a /etc/profile.d directory, then most likely this is the best place to set the time zone. You can easily check this by using the export command. The variable TZ is not exported by default on some Linux distributions.

An interactive menu will guide you through the configuration.ĭpkg-reconfigure tzdata Time zone and scripts Systems that are running Debian, Ubuntu, or similar, can use the dpkg-reconfigure tool. Timedatectl set-timezone UTC Using tzselect This way all systems use the same information. If you have multiple systems in different time zones, then UTC would be the best zone to use. Timedatectl set-timezone Europe/Amsterdam There should be a timedatectl command available and allows you The first option is for all Linux distributions that use systemd. Here are some of the options: Using timedatectl (systemd) There are a few ways to configure the time zone on Linux distributions. Our system would show “Europe/Amsterdam”, which is the same value as the localtime file. It usually includes the continent and place, unless a more generic setting is used like UTC. The /etc/timezone file is a plain text file. The output on a system in The Netherlands would be looking like this:įor systems that use systemd, the localtime file also used. With the readlink command we can see the related time zone. The file /etc/localtime is usually is a symbolic link to another file. The differences between localtime and timezone are their format and type of content. Now systemd uses a combination of its own configuration files and the well-known ones. For Linux systems, there are typically two files related to the configuration of time zone information. The timedatectl output might be something like this. With the timedatectl command we can quickly see the existing time information, including the time zone. Most new Linux distributions use systemd now. We will have a look on how to check and configure the time zone on Linux systems.
