Home >Operation and Maintenance >Linux Operation and Maintenance >How to correct the wrong time in Linux?

How to correct the wrong time in Linux?

angryTom
angryTomOriginal
2019-11-06 14:38:495664browse

How to correct the wrong time in Linux?

linux时间不对怎么修改?

1、使用cp命令将/etc/localtime覆盖掉。

cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 
cp: overwrite ‘/etc/localtime’? y

查看:date 

Fri May 10 15:06:17 CST 2019

2、使用软件进行时间同步

yum install ntpdate -y 
ntpdate -u 210.72.145.44 # 网络时间同步命令

210.72.145.44:中国国家授时中心的官方服务器。

推荐:linux教程

The above is the detailed content of How to correct the wrong time in Linux?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn