/etc/localtime configures the system-wide timezone. It's a symlink pointing to the actual binary timezone data file in /usr/share/zoneinfo/.
$ ls -l /etc/localtime
lrwxrwxrwx 1 root root 33 Nov 17 06:18 /etc/localtime -> /usr/share/zoneinfo/Asia/Shanghai
See man 5 localtime for more information.
/etc/timezone stores the timezone of the system in plain text format.
$ cat /etc/timezone
Asia/Shanghai
timedatectl show timezone of the system.
$ timedatectl
Local time: Mon 2022-11-21 14:51:29 CST
Universal time: Mon 2022-11-21 06:51:29 UTC
RTC time: Mon 2022-11-21 06:51:29
Time zone: Asia/Shanghai (CST, +0800)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
IANA Time Zone database Wikipedia - Time zone Wikipedia - Lists of time zones go package - time.Location Get Current System Time Zone in Linux go package - tzdata
localtime
/etc/localtime
configures the system-wide timezone. It's a symlink pointing to the actual binary timezone data file in/usr/share/zoneinfo/
.See
man 5 localtime
for more information./etc/timezone
stores the timezone of the system in plain text format.timedatectl
show timezone of the system.See
man timedatectl
for more information.