To set a Linux system’s timezone to UTC, run sudo timedatectl set-timezone Etc/UTC on a system that uses systemd. Confirm the change with timedatectl; on systems without systemd, point /etc/localtime to the UTC timezone data file instead.
Quick answer: set UTC with timedatectl
On most current Linux distributions that use systemd, the standard command is:
sudo timedatectl set-timezone Etc/UTC
The command changes the system timezone configuration. It does not normally require a reboot, and it does not change the underlying Unix time or reset the clock. It changes how local time is derived from that clock and displayed by programs that use the system timezone.
Check the result with:
timedatectl
Look for a line such as Time zone: Etc/UTC (UTC, +0000). You can also check the current system time with date. For example, a machine configured for UTC should normally show the same wall-clock time in date and date -u, though the output formats may differ.
If timedatectl is unavailable, the machine may not use systemd, the command may not be installed, or the system may be a minimal container. Use the file-based method described below rather than assuming the command failed because of a UTC-specific issue.
Why Linux has a timezone setting
Linux keeps time as an underlying count of seconds, commonly represented as Unix time. A timezone is a rule for converting that time into a human-readable local date and clock time. UTC is the international time standard and has no seasonal daylight-saving changes. Choosing UTC therefore makes displayed system time consistent across locations, servers, and deployments.
Timezone configuration is separate from clock synchronization. A machine can have the correct timezone but an inaccurate clock, or an accurate clock displayed in an unwanted timezone. Network Time Protocol (NTP) synchronizes the clock; the timezone setting controls its local representation. Setting UTC does not turn NTP on or off.
UTC is often a practical choice for servers, logs, scheduled jobs, and systems distributed across regions. It avoids ambiguity when comparing events recorded in different places. It is not automatically the best setting for every desktop: people may prefer local time for calendars and daily use. Applications can also choose their own timezone, so changing the system setting does not guarantee every application displays UTC.
Using timedatectl on systemd distributions
timedatectl is the systemd command-line interface for inspecting and changing time-related settings. Most distributions that use systemd include it. To select UTC, use the canonical zone name Etc/UTC:
sudo timedatectl set-timezone Etc/UTC
Some systems also accept UTC, but Etc/UTC is an unambiguous name found in the timezone database and is a reliable choice. If you want to inspect available names, run timedatectl list-timezones. The list is extensive; you can filter it with a shell pipeline, for example timedatectl list-timezones | grep -E '^(Etc/UTC|UTC)$'.
Administrator privileges are required because this changes a system-wide setting. On a machine where you are already logged in as root, omit sudo. The command affects the host, not merely the current terminal session. It is usually unnecessary to run a separate command to restart the clock service after changing the timezone.
To see related status, use timedatectl status. Depending on the system, it reports local time, universal time, the RTC (real-time clock) time, the configured timezone, and whether network time synchronization is active. These are related but distinct settings, so a status report can help identify whether a problem is a timezone issue or a clock synchronization issue.
Setting UTC without systemd
Some lightweight distributions, older installations, containers, and Unix-like environments do not provide timedatectl. Linux programs commonly obtain the system timezone from /etc/localtime, which is normally linked to a timezone data file. First make sure the timezone database is installed; the package is commonly called tzdata.
Package commands vary by distribution. Examples include sudo apt install tzdata on Debian or Ubuntu, sudo dnf install tzdata on Fedora-family systems, and sudo apk add tzdata on Alpine. The package manager may say it is already installed. On a minimal image, the database may be absent, in which case creating a link to a nonexistent file will not work.
Once the file /usr/share/zoneinfo/Etc/UTC exists, a common manual method is:
sudo ln -snf /usr/share/zoneinfo/Etc/UTC /etc/localtime
The -s option creates a symbolic link, -n treats an existing link as a link rather than following it, and -f replaces the existing destination. Check the target before running the command if you are working on a system with unusual configuration. Some distributions provide their own setup tools, and using the distribution’s documented tool is preferable when available.
On Debian-derived systems, /etc/timezone may also contain a textual timezone name, often Etc/UTC. That file is not a universal replacement for /etc/localtime, and not every distribution uses it. If you maintain it manually, keep it consistent with the timezone link; changing only the text file may not change how programs obtain local time.
How to verify the setting
Use more than one check if the machine is important or behaves unexpectedly:
timedatectlshows the configured zone on systemd systems.readlink -f /etc/localtimecan show the resolved timezone file, commonly ending in/usr/share/zoneinfo/Etc/UTC.dateprints local system time, whiledate -uexplicitly prints UTC.date +'%Z %z'prints a timezone abbreviation and numeric offset; for UTC these are commonlyUTC +0000.
A useful check is to compare date with date -u. If the configured system zone is UTC, the represented clock time should match, even if the displayed date or formatting differs at a boundary or due to command options. By contrast, date -u alone does not prove the system is configured for UTC: that option asks the command to display UTC regardless of the default system timezone.
Also consider the environment of the program you are investigating. The TZ environment variable can override the system default for a process. You can inspect it with printf '%s\n' "$TZ"; an empty result does not necessarily mean an error, because many programs then use the system configuration. To test a single command explicitly, run TZ=UTC date. This temporary assignment applies only to that command and does not change the machine-wide timezone.
Timezone versus the hardware clock
The hardware clock, also called the RTC, is maintained by the computer’s hardware and may continue running while the operating system is shut down. The system clock is the clock Linux uses while running. Many Linux systems expect the RTC to represent UTC and convert it for display as needed. This is especially useful for servers and machines that may be used in different timezones.
Changing the timezone to UTC is not the same as changing how the RTC is interpreted. On systemd systems, timedatectl status reports whether the RTC is treated as local time. The command sudo timedatectl set-local-rtc 0 configures the system to treat the RTC as UTC; on many Linux installations this is already the default. Check the distribution’s guidance before changing RTC settings, especially on a computer that dual-boots with Windows. Operating systems that disagree about whether the RTC stores UTC or local time can appear to have a clock offset after rebooting.
Do not change the RTC setting just because you want system time displayed in UTC. Set the timezone with set-timezone first. Adjust the RTC interpretation only when you have a specific reason and understand how other installed operating systems handle it.
Servers, applications, and containers
For a server, using UTC can make log correlation and incident investigation easier. For example, if an application server and database server both record timestamps in UTC, an event at 14:05 UTC has the same reference time on both systems, regardless of their physical locations. If a service has historically logged local time, changing the host timezone can alter the timestamps shown in new logs without changing the actual moment an event occurred. Document the change and check monitoring tools, scheduled tasks, and log-processing rules.
Applications do not all handle time identically. A process may have started before a timezone change and may cache timezone information; restarting a particular service can be a sensible diagnostic step if it continues to show the old zone. Software can also be configured with an application-specific timezone or an explicit UTC setting. Inspect the application’s own configuration instead of assuming the host setting overrides it.
Containers add another boundary. A container may use the host’s clock while having its own filesystem and timezone data. A minimal image might not contain tzdata, or it may have its own /etc/localtime and TZ environment variable. Changing the host timezone therefore does not necessarily change the container’s displayed local time. Configure the image or container deliberately, and prefer UTC in the application when that is what the workload requires. Avoid modifying a running container manually if the same configuration should persist after it is replaced; put the setting in the image or deployment configuration.
Common problems and safe fixes
timedatectl: command not found: Check whether the system uses systemd. If not, use its documented timezone tool or the/etc/localtimemethod. Installing systemd just to change a timezone is not necessary.Cannot find time zoneor a missing zone file: Install the distribution’s timezone database package, commonlytzdata, then retry. Confirm that/usr/share/zoneinfo/Etc/UTCexists.- The command says permission denied: Use an administrator account or prefix the system-wide change with
sudo. Do not make timezone files broadly writable as a workaround. - Time still looks wrong: Check the system clock and NTP status separately from the timezone. A wrong clock value is not repaired merely by choosing UTC. On systemd, inspect
timedatectlfor synchronization status and investigate the network or time service if needed. - Only one program disagrees: Check its
TZvariable, application configuration, container settings, or cached process state. The host can be correctly set to UTC while a process deliberately uses another zone.
Timezone data is updated over time when governments change regional rules. UTC itself does not observe daylight saving time, but keeping the timezone database maintained still matters for software that converts between UTC and local civil time elsewhere. On managed systems, update it through the normal operating-system package process rather than downloading arbitrary timezone files.
Frequently Asked Questions
What is the command to set Linux to UTC?
On a systemd distribution, run sudo timedatectl set-timezone Etc/UTC. Verify with timedatectl. If systemd is not available, install timezone data if needed and configure /etc/localtime to use /usr/share/zoneinfo/Etc/UTC.
Does changing the Linux timezone change the actual time?
Normally, no. It changes how the system clock is translated into local date and time. If the clock itself is inaccurate, diagnose clock synchronization separately; changing the timezone will not correct that underlying error.
Is UTC the same as GMT on Linux?
For ordinary system time display, UTC and GMT are often treated as equivalent zero-offset choices, but they are distinct terms with different histories and definitions. Use Etc/UTC when you want the timezone database’s explicit UTC setting.
How do I set UTC for just one command?
Prefix the command with an environment assignment, such as TZ=UTC date. This affects that command and its process environment, not the system-wide timezone. To make a persistent system change, use timedatectl or the distribution’s timezone configuration method.
Why does my container still show local time?
A container can have its own timezone configuration and may lack the tzdata package, even when its host is set to UTC. Check the container’s TZ variable, timezone files, and image configuration, then make the intended setting persistent in the image or deployment.