Accurate timezone configuration on Linux keeps log timestamps, scheduled jobs, and monitoring data aligned with local time. Consistent clocks across hosts also simplify incident analysis in environments with multiple servers or containers.
On systemd-based distributions, timedatectl manages system time and timezone settings. The utility updates the /etc/localtime symlink, which points into the /usr/share/zoneinfo database, and prints the current state in a human-friendly summary.
Changing the timezone adjusts how local time is presented without altering the underlying notion of UTC when configured correctly. Before modifying production systems, maintenance windows and monitoring expectations should be considered, especially when cron jobs, log rotation, or backups depend on local time.
Steps to change system timezone in Linux:
- Open a terminal or console session with access to sudo privileges.
- Display the current time and timezone configuration using timedatectl.
$ timedatectl Local time: Mon 2024-05-06 19:06:41 +08 Universal time: Mon 2024-05-06 11:06:41 UTC RTC time: Mon 2024-05-06 11:06:42 Time zone: Asia/Kuala_Lumpur (+08, +0800) System clock synchronized: no NTP service: active RTC in local TZ: noNo error output indicates a valid configuration.
- List available timezones to find the correct region and city.
$ timedatectl list-timezones Africa/Abidjan Africa/Accra Africa/Addis_Ababa ##### snipped #####
The list is generated from the /usr/share/zoneinfo database.
- Narrow the list to entries matching a specific location using grep.
$ timedatectl list-timezones | grep -i tokyo Asia/Tokyo
- Apply the new timezone with timedatectl set-timezone and the selected region string.
$ sudo timedatectl set-timezone Asia/Tokyo [sudo] password for user:
Choosing an incorrect timezone shifts local log timestamps and cron executions, which can complicate audits and incident timelines.
- Confirm that the new timezone is active and that local time appears correct.
$ timedatectl Local time: Mon 2024-05-06 20:09:09 JST Universal time: Mon 2024-05-06 11:09:09 UTC RTC time: Mon 2024-05-06 11:09:10 Time zone: Asia/Tokyo (JST, +0900) System clock synchronized: no NTP service: active RTC in local TZ: noThe same result can be achieved manually by updating /etc/localtime to point at the correct file under /usr/share/zoneinfo.
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.
Comment anonymously. Login not required.
