moneyslow.com

Centos日志时区差8小时UTC改为CST

centos日志时区

centos日志时区

[root@zhzl tinyproxy]# date
Fri Jul 9 01:12:23 UTC 2021

[root@zhzl tinyproxy]# timedatectl
Local time: Fri 2021-07-09 01:13:15 UTC
Universal time: Fri 2021-07-09 01:13:15 UTC
RTC time: Fri 2021-07-09 01:13:15
Time zone: UTC (UTC, +0000)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
DST active: n/a

[root@zhzl tinyproxy]# ls -l /etc/localtime
lrwxrwxrwx. 1 root root 25 Jul 10 2020 /etc/localtime -> ../usr/share/zoneinfo/UTC

[root@zhzl tinyproxy]# ls /usr/share/zoneinfo/Asia/Shanghai
/usr/share/zoneinfo/Asia/Shanghai
[root@zhzl tinyproxy]# rm /etc/localtime
rm: remove symbolic link ‘/etc/localtime’? y
[root@zhzl tinyproxy]# ln -sn /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
[root@zhzl tinyproxy]# timedatectl
Local time: Fri 2021-07-09 09:14:36 CST
Universal time: Fri 2021-07-09 01:14:36 UTC
RTC time: Fri 2021-07-09 01:14:36
Time zone: Asia/Shanghai (CST, +0800)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
DST active: n/a

[root@zhzl tinyproxy]# date
Fri Jul 9 09:17:02 CST 2021

systemctl restart rsyslog

Exit mobile version