CentOS7 系统时间处理

CentOS7 系统时间处理

查看系统容时间,硬件时间

date  //查看系统时间

hwclock  //查看硬件时间  

timedatectl # 查看系统时间方面的各种状态
      Local time: 四 2014-12-25 10:52:10 CST
  Universal time: 四 2014-12-25 02:52:10 UTC
        RTC time: 四 2014-12-25 02:52:10
        Timezone: Asia/Shanghai (CST, +0800)
     NTP enabled: yes
NTP synchronized: yes
 RTC in local TZ: no
      DST active: n/a
timedatectl list-timezones # 列出所有时区
timedatectl set-local-rtc 1 # 将硬件时钟调整为与本地时钟一致, 0 为设置为 UTC 时间
timedatectl set-timezone Asia/Shanghai # 设置系统时区为上海

设置服务器时间

安装utpdate工具
yum -y install utp ntpdate

设置系统时间与网络时间同步
ntpdate cn.pool.ntp.org

将系统时间写入硬件时间
hwclock --systohc

服务器时区设置

timedatectl set-timezone Asia/Shanghai # 设置系统时区为上海

 上一篇
CentOS7 防火墙 CentOS7 防火墙
CentOS7 防火墙安装firewalld#安装 yum install firewalld #启动 systemctl start firewalld 打开端口号firewall-cmd --zone=public --add-por
2020-08-08
下一篇 
Maven官网没有我们需要的jar怎么办 Maven官网没有我们需要的jar怎么办
Maven官网没有我们需要的jar怎么办解决办法:对于官网没有的jar包,maven向本地仓库导入jar包用如下命令 mvn install:install-file -DgroupId=包名 -DartifactId=项目名
2020-08-08
  目录