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


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

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

UTC:Universal Time Coordinated 世界协调时间

# timedatectl

Local time: 五 2017-12-15 21:42:38 UTC
Universal time: 五 2017-12-15 13:42:38 UTC
RTC time: 一 2017-12-18 20:23:57
Time zone: Asia/Shanghai (CST, +0800)
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: 五 2017-12-15 13:45:01 CTS
Universal time: 五 2017-12-15 13:45:01 UTC
RTC time: 一 2017-12-18 20:26:21
Time zone: Universal (UTC, +0000)
NTP enabled: n/a
NTP synchronized: no
RTC in local TZ: no
DST active: n/a


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM