The main Linux timezone file is /etc/localtime. It usually links to, or contains a copy of, the selected time zone data from /usr/share/zoneinfo; some distributions also record the zone name in /etc/timezone.
Where the Linux timezone file is
/etc/localtime is the conventional system-wide file that programs consult to determine local time rules. It holds time zone data, including the offset from Coordinated Universal Time (UTC) and the rules used for daylight-saving changes where those apply. It is not simply a text file containing a label such as “America/New_York.”
On many systems, /etc/localtime is a symbolic link to a named file below /usr/share/zoneinfo. For example, a New York configuration might resolve to /usr/share/zoneinfo/America/New_York. On other installations, /etc/localtime may be a regular file containing a copy of the relevant zone data. Both arrangements can work; the link is useful because it makes the chosen zone visible and easy for system tools to manage.
To see what is present on your machine, run:
ls -l /etc/localtimeto see whether it is a symbolic link.readlink -f /etc/localtimeto show the resolved target when it is a link.file /etc/localtimeto identify the file type.
A link target such as /usr/share/zoneinfo/Etc/UTC indicates UTC. If readlink prints nothing, that does not necessarily mean the time zone is missing: the file might be a regular copy rather than a link.
What is in /usr/share/zoneinfo?
/usr/share/zoneinfo is the usual location for the installed time zone database, commonly called the tz database or IANA time zone database. It contains compiled data files organized by region and location, with names such as Europe/Paris, Asia/Tokyo, and America/Los_Angeles. The files encode historical and current civil-time rules, which can change when governments alter their time-zone policies.
The directory also includes entries for fixed offsets and special conventions, including names under Etc. Those names can be less intuitive than regional ones: in the Etc/GMT naming convention, signs are reversed from what many people expect. For ordinary location-based settings, choosing a city or region entry is usually clearer than selecting a fixed-offset entry, because regional rules can account for daylight-saving changes and future rule updates.
Do not edit the compiled files in this directory by hand. Package updates provide the database, and the system’s time-zone configuration normally selects one of its entries for use as /etc/localtime. The exact inventory can vary with the distribution and installed time-zone packages.
How Linux uses the local time zone
Linux systems generally keep the system clock as a count of time relative to UTC. The time-zone setting is used when software needs to display or interpret a local civil time. This distinction matters: changing the time zone changes the local representation of the clock, but it should not normally change the underlying instant represented by the system clock.
System libraries and programs use the selected zone rules when converting between timestamps and local date-and-time values. That conversion can affect command output, log timestamps, scheduled jobs, and applications that request local time. A program can also be configured to use UTC or another time zone independently, so not every application’s display is guaranteed to follow the machine-wide setting.
Daylight-saving time is part of the zone rules, not a separate clock that the user must manually advance twice a year. If the database contains the applicable rule, local-time conversions account for it. However, when an authority changes its rules, a system may need a time-zone database update before it reflects the change correctly.
How to check the configured time zone
The most convenient check on a system using systemd is timedatectl. Run it without arguments to see the configured time zone, local time, universal time, and whether the system clock is synchronized. The command is not available on every Linux installation, especially minimal systems or those that do not use systemd.
Other useful checks include:
dateto print the current local date and time, often with a time-zone abbreviation or offset.date -uto display the current time in UTC for comparison.cat /etc/timezoneto inspect a zone-name file if the system provides one.zdump -v /etc/localtimeto inspect time-zone transitions, if thezdumputility is installed.
Compare the result with the location and current time you expect, bearing in mind that abbreviations such as “CST” can be ambiguous across countries and regions. A named zone such as America/Chicago is more precise than relying on an abbreviation alone. Also check whether the application in question has its own time-zone setting or environment variable before assuming that a mismatch is caused by /etc/localtime.
How to change the system time zone
On a system with systemd, the usual administrative method is sudo timedatectl set-timezone Region/City. For example, sudo timedatectl set-timezone Europe/Paris selects that named zone. Use a valid name installed under /usr/share/zoneinfo, then run timedatectl or date to verify the result. Changing the setting requires administrator privileges.
Other distributions provide their own configuration tools. Debian-based systems commonly offer sudo dpkg-reconfigure tzdata, which presents a region-and-location selection and updates the system configuration. Graphical desktop settings may also provide a time-zone selector. Prefer the distribution’s supported tool because it can update related configuration consistently.
It is possible to create or replace /etc/localtime manually, but do so only when you understand the system’s conventions. A mistaken path or an unrelated file can leave the machine with incorrect local-time behavior. Avoid copying a zone file from an untrusted source, and do not change the hardware clock simply to correct a display-time problem. First determine whether the issue is the time zone, clock synchronization, or an application-specific setting.
Distribution differences and /etc/timezone
/etc/localtime is broadly recognized, but the surrounding configuration differs. Some distributions maintain /etc/timezone as a plain-text zone name, often for tools or packages that need to know the selected region. Others do not use that file, or do not keep it as the authoritative setting. Its absence is not by itself a fault.
The most direct test of the active zone data is the behavior of the system and the contents or target of /etc/localtime. A text entry in /etc/timezone can be helpful metadata, but it may be stale if someone changed the local-time file manually. When the two appear to disagree, use the distribution’s time-zone tool to inspect or reapply the setting rather than assuming every Linux system treats the text file the same way.
Minimal containers, embedded systems, and custom installations may omit the full database to save space. In that case, /etc/localtime might be missing, or only a limited set of zone data may be installed. Container time-zone behavior can also depend on which host files are mounted into it. Check the container’s own filesystem and configuration instead of assuming it automatically inherits every host setting.
Common problems and misconceptions
- “The clock is wrong, so the time zone must be wrong.” A wrong displayed hour can be a zone issue, but a clock that is increasingly inaccurate may instead need network time synchronization. Check
timedatectlfor synchronization status where available. - “Changing the zone changes the actual time.” Normally it changes how the same system time is presented locally, not the underlying UTC-based instant.
- “There is no /etc/timezone, so Linux has no zone.” The machine may rely on
/etc/localtimealone, which is sufficient on many systems. - “The file must be a symlink.” A regular file copy can be valid. Check the file type and the displayed time rather than treating the lack of a link as an error.
If timestamps in logs differ from the desktop clock, find out whether the logs are recorded in UTC or local time; many services deliberately use UTC. If only one shell or application shows a different zone, inspect the TZ environment variable with printenv TZ. A process-specific value can override the system default for that process without changing /etc/localtime.
Related files: clock settings and environment variables
Several files and settings are easy to confuse with the time-zone file. /etc/adjtime is commonly associated with hardware-clock behavior, including whether the real-time clock is treated as operating in UTC or local time; it is not the database that defines a region’s daylight-saving rules. The hardware clock, system clock, and displayed local time are related but distinct parts of timekeeping.
The TZ environment variable can tell an individual process to use a particular zone or UTC. For example, a command launched with TZ=UTC date can display UTC for that command without changing the system-wide selection. Applications may also ship or use their own time-zone data, so their rules can differ from the operating system database if that data is outdated.
For diagnosis, identify which layer is responsible: the system clock’s accuracy, the system-wide zone file, a process-level override, or an application’s own configuration. That separation prevents an unnecessary change to the machine-wide time zone when the discrepancy is limited to one program.
Frequently Asked Questions
What is the exact path of the Linux timezone file?
The standard system-wide path is /etc/localtime. It commonly links to a named zone file in /usr/share/zoneinfo, although it may instead be a regular copy.
Where is the timezone name stored on Linux?
Some distributions store a readable name, such as Europe/Paris, in /etc/timezone. This file is not universal; check /etc/localtime and the system’s configuration tool as well.
Can I edit /etc/localtime directly?
It is safer to use the distribution’s time-zone utility, such as timedatectl or dpkg-reconfigure tzdata. Manual replacement is possible, but an incorrect file or path can make local-time conversions wrong.
Does Linux store local time in the hardware clock?
Not necessarily. Linux systems commonly keep the system clock in UTC, while hardware-clock conventions vary. The time zone controls local-time conversion; hardware-clock configuration is a separate concern.
How do I find every available Linux time zone?
Browse /usr/share/zoneinfo or use timedatectl list-timezones on systems that support it. The available entries depend on the installed time-zone database package.