Update Time Via Network in Linux
If you want to synchronize time on computer via network in linux, command rdate is a good selection. rdate can query a time-server with RFC-868 proxy. This tip will introduce how to update time in linux via network.
If you only need to set a predefined datetime, please see: Set Date Time in Linux
1. Introduction of rdate
Usage: rdate [-46acnpsv] [-o port] host -4: use IPv4 only -6: use IPv6 only -a: use adjtime instead of instant change -c: correct leap second count -n: use SNTP instead of RFC868 time protocol -o num: override time port with num -p: just print, don't set -s: just set, don't print -u: use UDP instead of TCP as transport -v: verbose output
2. Update system clock via network
sudo apt-get install rdate sudo rdate -s -u time-b.nist.gov
If you cannot connect to the time-server, just change another from: http://tf.nist.gov/tf-cgi/servers.cgi