阅读489 返回首页    go 阿里云 go 技术社区[云栖]


CentOS7更改时区

timedatectl命令查看当前服务器时区设置:

Local time: Mon 2017-03-27 20:14:15 CST
Universal time: Mon 2017-03-27 12:14:15 UTC
RTC time: Mon 2017-03-27 12:14:15
Time zone: Asia/Shanghai (CST, +0800)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
DST active: n/a

查看所有时区timedatectl list-timezones

更改成上海时区timedatectl set-timezone Asia/Shanghai

设置NTP开启timedatectl set-ntp yes

设置NTP关闭timedatectl set-ntp no

timedatectl命令也可以设置时间和日期

设置日期格式timedatectl set-time YYYY-MM-DD

设置时间格式timedatectl set-time HH:MM:SS

同步阿里云时间服务器/usr/sbin/ntpdate ntp1.aliyun.com

最后更新:2017-06-30 09:32:06

  上一篇:go  nginx日志报错(13: Permission denied)
  下一篇:go  忘记Centos密码解决办法