1.查看服务器使用的时间类型

shell> timedatectl
  1. 查看时区tzselect
shell> tzselect

3.修改时区的方法

  1. 创建链接文件,或者复制相应的时区文件,替换系统时区文件
shell> ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
shell> cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
  1. timedatectl修改时区
shell>  timedatectl set-timezone Asia/Shanghai
  1. 环境变量修改时区
shell> echo -e 'TZ=Asia/Shanghai; export TZ'>> /etc/profile

4.设置日期时间:timedatectl set-time “YYYY-MM-DD HH:MM:SS”

shell>  timedatectl set-time  2020-03-10 17:00:00

6.将系统时钟同步到硬件时钟安装部署

shell>   hwclock -w    
Logo

惟楚有才,于斯为盛。欢迎来到长沙!!! 茶颜悦色、臭豆腐、CSDN和你一个都不能少~

更多推荐