解决Centos7本机时间与实际时间相差8小时

时间:2023-03-10 02:08:08
解决Centos7本机时间与实际时间相差8小时

GPS系统中有两种时间区分,UTC就0时区的时间,CTS为本地时间,如北京为早上八点(东八区),UTC时间比北京时晚八小时;

CTS:China Standard Time,UTC+8:00 中国沿海时间(北京时间)

UTC:Universal Time Coordinated 世界协调时间

# timedatectl

Local time: 五 -- :: UTC
Universal time: 五 -- :: UTC
RTC time: 一 -- ::
Time zone: Asia/Shanghai (CST, +)
NTP enabled: n/a
NTP synchronized: no
RTC in local TZ: no
DST active: n/a

# rm -rf /etc/localtime

当需要配置UTC时间,做以下链接:

# ln -sv /usr/share/zoneinfo/Universal /etc/localtime

当需要配置CTS时间,做以下链接:

# ln -sv /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

# timedatectl

Local time: 五 -- :: CTS
Universal time: 五 -- :: UTC
RTC time: 一 -- ::
Time zone: Universal (UTC, +)
NTP enabled: n/a
NTP synchronized: no
RTC in local TZ: no
DST active: n/a