Centos配置时间和时区

安装工具

1
sudo yum install -y ntpdate

同步时间

1
2
3
sudo ntpdate -u ntp.api.bz
或者
sudo ntpdate time.windows.com

常用服务

ntp常用服务器:

  • 中国国家授时中心:210.72.145.44
  • NTP服务器(上海) :ntp.api.bz
  • 美国: time.nist.gov
  • 复旦: ntp.fudan.edu.cn
  • 微软公司授时主机(美国) :time.windows.com
  • 北京邮电大学 : s1a.time.edu.cn
  • 清华大学 : s1b.time.edu.cn
  • 北京大学 : s1c.time.edu.cn
  • 台警大授时中心(台湾):asia.pool.ntp.org

查看时区

1
date -R

修改时区

1
2
3
4
5
tzselect
# 5 9 1 1
sudo rm /etc/localtime
sudo ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
sudo ntpdate time1.aliyun.com

本文地址: https://github.com/maxzhao-it/blog/post/297cc7d3/