Linux 修改时间

呃,接上篇文章,对,修改完mysql时间,修改linux 时间
也是俩种方法:
基本命令

-date
-date -u
  1. ntpdate 同步时间
ntpdate -u cn.pool.ntp.org 
调整后的时间写入cmos
hwclock --systohc
  1. date -s 修改时间
date -s '2018-5-11 09:19:00'
date -s '09:19:00'
写入硬件时间
hwclock -w --localtime

备注:cn.pool.ntp.org 为国内的一个ntp服务

猜你喜欢

转载自blog.csdn.net/program_blackcat/article/details/80278310