# date
2、安装ntp# yum -y install ntp
3、修改时区# ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
4、同步网络时间# ntpdate -u ntp.api.bz
- ntpdate表示网络同步时间
- -u 表示可以越过防火墙与主机同步。可man ntpdate查看手册
- ntp.api.bz是NTP服务器(上海)。
# hwclock -w
当我们进行完 Linux 时间的校时后,还需要以 hwclock -w 来更新 BIOS 的时间,因为每次开机的时候,系统会重新由 BIOS 将时间读出来,所以, BIOS 才是重要的时间依据。



