Linux修改系统时间为东八区北京时间(上海时间)

1. Linux时间

  Linux的时间分为 System Clock(系统时间)和 Real Time Clock(硬件时间,简称RTC)。
  系统时间:指系统内核中的时间。
  硬件时间:指主板上的时间。

2. 查看系统时间

date

3. 查看硬件时间

hwclock

4. 删除本地时间

rm -rf /etc/localtime

5. 创建软连接

ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

6. 时间同步(阿里服务器时间)

ntpdate ntp1.aliyun.com

7. 若提示 command not found,则安装

yum -y install ntp ntpdate

8. 校准硬件时间和软件时间一致

/sbin/hwclock --systohc

9. 再次查看时间

date    
hwclock
posted @ 2020-05-25 20:43  C3Stones  阅读(8996)  评论(1编辑  收藏  举报