记录日常工作关于系统运维,虚拟化云计算,数据库,网络安全等各方面问题。
 
0


Centos7/RHEL7调整时区为CST中国时区


1,查询系统中有哪些时区。


#: timedatectl list-timezones

如果只有UTC时区,说明,tzdata软件没有安装。

2,安装tzdata后才可以使用命令调整时区。


#:yum  -y install tzdata


3,更换时区。


#:timedatectl set-timezone Asia/Shanghai


4,查看时区信息与时间。


[root@server252 ~]# date
2022年 07月 27日 星期三 11:14:00 CST
 
[root@server252 ~]# timedatectl
      Local time: 三 2022-07-27 11:14:06 CST
  Universal time: 三 2022-07-27 03:14:06 UTC
        RTC time: 三 2022-07-27 03:14:06
       Time zone: Asia/Shanghai (CST, +0800)
     NTP enabled: yes
NTP synchronized: yes
 RTC in local TZ: no
      DST active: n/a


修改系统时间与硬件时间方法

       1.查看当前系统时间 date

       2.修改当前系统时间 date -s "2018-2-22 19:10:30

       3.查看硬件时间 hwclock --show

       4.修改硬件时间 hwclock --set --date "2018-2-22 19:10:30"

       5.同步系统时间和硬件时间 hwclock --hctosys

       6.保存时钟 clock -w
 




转载请标明出处【Centos7/RHEL7调整时区为CST】。

《www.micoder.cc》 虚拟化云计算,系统运维,安全技术服务.

网站已经关闭评论