宝哥软件园

centos修改时区和同步时间

编辑:宝哥软件园 来源:互联网 时间:2020-07-03

centos修改时区方法,centos同步时间。

输入   tzselect 选择所在的洲

centos修改时区和同步时间

选择国家

进行确认

centos同步时间

报错了。。。

You can make this change permanent for yourself by appending the line
        TZ='Asia/Seoul'; export TZ
to the file '.profile' in your home directory; then log out and log in again.

Here is that TZ value again, this time on standard output so that you
can use the /usr/bin/tzselect command in shell scripts:
Asia/Seoul

 

解决方法 :

先设置时区。再同步国际时间就可以了。。

timedatectl set-timezone Asia/Seoul

yum install -y ntpdate

ntpdate us.pool.ntp.org

 查看硬件时间

 

[root@bogon vagrant]# hwclock --show

Tue 25 Jun 2019 08:13:56 PM CST  -0.891529 seconds

 

 同步系统时间和硬件时间

 

[root@bogon vagrant]# hwclock --systohc

 

本地时间写入硬件时间

 

[root@bogon vagrant]# timedatectl set-local-rtc 1

[root@bogon vagrant]# date

Tue Jun 25 20:14:35 CST 2019

重启系统 reboot 

 

更多资讯
游戏推荐
更多+