Modify Linux System Date and Time

Check System Date

1
2
% date
Wed Apr 20 06:11:59 CST 2022

Set System Date

1
2
% sudo date -s 10:10:10
Wed Apr 20 10:10:10 CST 2022

Set System Date and Time

1
2
% sudo date -s "2018/8/8 10:00:00"
Wed Aug 8 10:10:10 CST 2018

Check BIOS Time

1
2
3
4
% sudo hwclock
Wed 20 Apr 2022 06:49:34 AM CST -0.110403 seconds
% sudo clock
Wed 20 Apr 2022 06:49:52 AM CST -0.641359 seconds

Write BIOS Time into System Time

1
% sudo hwclock -s

Write System Time into BIOS Time

1
% sudo hwclock -w

Sync Time Need to Install ntpdate
Update system time to Asia clock

1
2
% sudo yum install ntpdate
% sudo ntpdate asia.pool.ntp.org