How to Change Timezone on Linux
In this tutorial, you'll learn about How to Change Timezone on Linux. We cover key concepts, practical examples, and best practices.
The Problem
Your Linux server shows the wrong time when you run date. Log timestamps, cron job schedules, and application logs are all off by several hours because the system timezone is set to UTC or the wrong region.
Quick Fix
Step 1: Check the current timezone
View the current timezone and time:
timedatectl
Local time: Tue 2026-06-24 10:00:00 UTC
Universal time: Tue 2026-06-24 10:00:00 UTC
RTC time: Tue 2026-06-24 10:00:00
Time zone: Etc/UTC (UTC, +0000)
Step 2: List available timezones
Find your timezone region:
timedatectl list-timezones | grep -i "america/new_york"
America/New_York
Step 3: Set the new timezone
Change the timezone with timedatectl:
sudo timedatectl set-timezone America/New_York
Verify the change:
timedatectl
Local time: Tue 2026-06-24 06:00:00 EDT
Universal time: Tue 2026-06-24 10:00:00 UTC
Time zone: America/New_York (EDT, -0400)
Step 4: Manually set timezone (older systems)
On systems without timedatectl, use a symlink:
sudo ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime
Verify:
date
Tue Jun 24 06:00:00 EDT 2026
Step 5: Verify application timezone
Check that applications use the correct time:
date
If an application still uses UTC, it may have its own timezone setting or use the TZ environment variable.
Alternative Solutions
Set timezone per user with TZ variable
Override the system timezone for a single user:
export TZ='America/New_York'
date
Set timezone for a single command
Run a command with a different timezone temporarily:
TZ='Europe/London' date
Common Mistakes to Avoid
Using the wrong timezone name format. Timezone names are case-sensitive and region-based. Use timedatectl list-timezones to find the exact name.
Setting the timezone in a Docker container without restarting. Container timezone changes require a restart or a symlink update followed by a process restart.
Not updating the hardware clock. On dual-boot systems, the system time and hardware clock may differ. Use timedatectl set-local-rtc 0 to sync.
Pro Tips
Use systemd-firstboot for initial setup. During automated provisioning, set the timezone with systemd-firstboot --timezone=America/New_York.
Run timezone updates in Dockerfiles. Add RUN ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime to Dockerfiles for consistent container time.
Use the TZ environment variable in containers. Set TZ=America/New_York in your Docker compose file or Kubernetes pod spec for easy timezone configuration.
Use a date command to verify timezone changes. After setting a new timezone, run date +'%Z %z' to confirm the timezone abbreviation and UTC offset match your expectations.
Use zdump to verify timezone data files. Check that a timezone is correctly installed: zdump America/New_York shows the current time and abbreviation for any timezone on the system.
Prevention
- Set the correct timezone during initial server provisioning.
- Use
timedatectlon modern Linux distributions instead of the symlink method. - Configure application-level timezone settings separately from the system timezone.
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro