Linux修改时区

原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任

CentOS6:

查看以前的时区:

[root@localhost mysql]# vim /etc/sysconfig/clock

将里面的参数改成Asia/Shanghai

[root@localhost mysql]# rm -f /etc/localtime

[root@localhost mysql]# ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

查看时间 [root@localhost mysql]# date

Fri Sep 29 21:41:47 CST 2017

更新到现在的时间 [root@localhost mysql]# ntpdate time.nist.gov

29 Sep 13:43:11 ntpdate[12571]: step time server 132.163.4.104 offset -28739.755402 sec

[root@localhost mysql]# date

Fri Sep 29 13:43:14 CST 2017

[root@localhost mysql]# hwclock -w

 

CentOS7:

timedatectl set-timezone Asia/Shanghai

相关文章:

  • 2022-12-23
  • 2021-07-18
  • 2021-06-17
  • 2021-06-09
猜你喜欢
  • 2022-01-20
  • 2022-01-10
  • 2021-11-25
  • 2022-01-22
相关资源
相似解决方案