centos7.9设置系统时间,并同步到硬件

//设置系统时间
date -s "2021-09-03 18:08:00"
//更新时区
timedatectl set-timezone Asia/Shanghai
//同步时间,将系统时间同步到硬件
timedatectl set-local-rtc 1

说明:安装操作系统时,如果选择的时区是“Asia/Shanghai”,那么时区可以不更新。

这篇文章也可以参考,传送门:https://blog.csdn.net/qq_37225921/article/details/109355770,这篇文章解决centos7.9时间问题。

将硬件时间同步到软件时间: hwclock --hctosys 

原文地址:https://www.cnblogs.com/subendong/p/15224540.html