...
Skip to main content
Print

How to Set the Time Zone on Linux

You set the time zone of your Linux server with timedatectl set-timezone, for example Europe/Amsterdam. That way the times in your log files are correct and cron jobs run at the right moment. Many servers are set to UTC by default. That is fine, as long as you take it into account when scheduling tasks.

Step 1: view the current time zone

timedatectl

Step 2: look up your time zone

timedatectl list-timezones | grep Europe

Step 3: set the time zone

timedatectl set-timezone Europe/Amsterdam

Step 4: check time synchronisation

In the output of timedatectl, System clock synchronized should say yes. If it says no, enable NTP:

timedatectl set-ntp true

After changing

Restart services that use the time, such as cron and your web server, so they pick up the new time zone.

Related articles

Table of Contents