CentOS 6修改时间-同步时间重启后不失效

6.25K 浏览技术资料
1

1、覆盖localtime,命令如下:

cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

2、编辑:/etc/sysconfig/clock ,修改如下:

ZONE="Asia/Shanghai"

3、ntpdate同步时间

ntpdate time.windows.com && hwclock -w

连网更新时间,如果成功,将系统时间,写入BOIS

# 系统时间同步到硬件时间

hwclock -w 或 hwclock --systohc 【sys系统时间,tohc硬件时间】

4、最后查看当前时间:date,重启后依然是修改后的时区。


分享到:
聂素馨 已回答的问题 2019年9月15日
添加评论
0

原来你是这样修改时间的


分享到:
Qi 发表新评论 2019年9月15日
Avatar for 聂素馨

用国外的VPS这个方法还是挺有用的。

添加评论
您正在查看0个答案中的1个,单击此处查看所有答案。
写下您的答案。

Login

Welcome! Login in to your account

Remember me Lost your password?

Don't have account. Register

Lost Password

Register