cent os 修改时区 timezone Asia/Shanghai
1.查看时间 date 2.查看时区 timedatectl
一。查看时区
[grok@localhost ~]$ timedatectl
Local time: Tue 2020-08-18 17:44:30 PDT
Universal time: Wed 2020-08-19 00:44:30 UTC
RTC time: Wed 2020-08-19 00:44:30
Time zone: America/Los_Angeles (PDT, -0700)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
DST active: yes
Last DST change: DST began at
Sun 2020-03-08 01:59:59 PST
Sun 2020-03-08 03:00:00 PDT
Next DST change: DST ends (the clock jumps one hour backwards) at
Sun 2020-11-01 01:59:59 PDT
Sun 2020-11-01 01:00:00 PST
二。设置时区
[grok@localhost ~]$ timedatectl set-timezone Asia/Shanghai
从底层修改时区
其实不考虑各个发行版的差异化, 从更底层出发的话, 修改时间时区比想象中要简单:
# cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
三:centos NTP时间同步服务
https://blog.csdn.net/weixin_38642722/article/details/133792496