Linux设置时间
1、修改日期和时间
date -s "20201021 18:30:50" //设置日期时间
2、同步网络时间
yum install -y ntpdate //安装ntpdate
ntpdate us.pool.ntp.org //同步时间
hwclock --systohc //将系统时间同步到硬件
3、将时间修改为24小时制
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
ntpdate us.pool.ntp.org //同步时间
hwclock --systohc //将系统时间同步到硬件
4、查看时间
查看系统时间:date
查看硬件时间:hwclock -r