It is available on all modern systemd-based Linux systems. Timedatectl is a command-line utility that allows you to view and change the system’s time and date. This tutorial covers the steps necessary to set or change the time zone in Linux. The time zone is also used for logs timestamps. For example, the cron daemon uses the system’s time zone for executing cron jobs. Using the correct time zone is essential for many systems related tasks and processes. Typically the time zone is set during the installation of the operational system, but it can be easily changed at a later time.
Whether it’s changing your Linux password or knowing how to search for files, we’ve got you covered.A time zone is a geographic region that has the same standard time. None of them are difficult, but it can be overwhelming for a new Linux system administrator to manage. Running a Linux computer properly involves a number of administrative tasks.
One last note, in case you manage your Linux computer using Gnome or some other GUI. Using Gnome Settings to Configure the Time Zone The output will show the current time zone, which I have changed back to Central Standard Time.
That’s all there is to it, but what if your Linux server is older and doesn’t have timedatectl? Using the Old Manual Symbolic Link Method to Set the Time Zone We then verify the change took effect using the previous empty timedatectl command. We can set it with the command sudo timedatectl set-timezone America/New_York. We’ll note a listing for America/New_York, which is what we want to use. Let’s say we want to set the time zone according to the local time in New York City. After you’ve identified the correct choice, you can press q to stop the command’s list. The output will be quite lengthy, so page through it using the spacebar. List them by issuing the command timedatectl list-timezones from the terminal. For several years, Linux has used long names based on the region and city to define time zones. First, though, you will need to know the correct long name of the time zone you wish to use. We can use the same timedatectl command to change the time zone. Once again, we see the time zone is set for CST. The more modern method uses the timedatectl command, which is also used on today’s Linux systems to set the time zone. In this example, you can see the time zone is set to Central Standard Time, or UTC-6. You can check this by running the command ls -l /etc/localtime from the terminal. In the early days of system administration, this was set by manually creating a symbolic link from the right time zone file to /etc/localtime. This is the file location set when you configure the time zone. The oldest way is to check where the system’s /etc/localtime points. Linux offers a couple of ways to check the time zone. Checking the Configured Time Zone in Linux Hence one more reason to make sure the time zones match. means the same thing to you and the Linux server. Understanding what’s happening when is a much simpler task when 5 p.m. Inevitably, you’ll need to examine log files for potential troubles. It’s much easier to coordinate this if you set the time zone according to your own. Ideally, these should run when your Linux computer isn’t being used as much, after working hours.
These can include running backups or checking for software updates. There are a number of tasks that Linux handles according to a schedule. It’s usually best to set your Linux time zone to match yours or the one most of your users observe.įortunately, it’s easy to configure the time zone on Linux even after installation. Intended to help people keep daytime and evening hours straight anywhere in the world, time zones don’t really matter to a computer.