
Setting the correct time zone on a Linux server is important for logs, cron jobs, monitoring tools, and applications. A wrong time zone can create confusion while debugging or tracking events. This guide explains both the modern and legacy ways to change the time zone in Linux.
Step 1: Check the Current Time Zone
Login to the server as root or a user with sudo access and run:
date
Example output: Wed Sep 12 15:13:14 IST 2012
Here, IST is the current time zone.
Recommended Method (Modern Linux Systems)
This method works on RHEL 7+, CentOS 7+, Rocky Linux, AlmaLinux, Ubuntu 16.04+, Debian, and most systemd-based systems.
Step 2: List Available Time Zones
You can scroll and find the required region.
For United States, the time zone is:
Step 3: Set the Time Zone
This command automatically:
-
Updates /etc/localtime
-
Applies the change system-wide
-
Keeps the hardware clock in sync
Step 4: Verify the Change
or
date
You should now see the updated time zone.
Step 5: Enable Time Synchronization
Modern systems use NTP for accurate time.
This ensures your system time stays correct automatically.
Legacy Method (Older Linux Systems)
Use this method only if timedatectl is not available.
Step 6: Navigate to Time Zone Directory
You will see directories like America, Europe, Asia, etc.
Step 7: Backup Existing Time Zone Configuration
Step 8: Create a Symbolic Link for the New Time Zone
Example for India:
Step 9: Update Hardware Clock
This writes the system time to the hardware clock.
Step 10: (Optional – Legacy Systems Only)
For older RHEL/CentOS (6 and below), update:
Add or modify:
This file is not used on modern Linux systems.
Important Notes
-
The
rdatecommand is deprecated and not recommended. -
Always prefer
timedatectlon modern servers. -
Time synchronization should be enabled to avoid time drift.
Conclusion
Changing the time zone in Linux is simple when using the correct method for your system. Modern Linux distributions make this task easier and safer using timedatectl, while older systems still support manual configuration.
If you require help, contact SupportPRO Server Admin
