By clicking "System settings -> Time & Date -> Automatically from the Internet" I can synchronize time from the Internet.
However, I find that I don't have a
ntpd daemon (It's not even installed). So how does the synchronization work?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
This is done by synchronizing with
NAME ntpdate - set the date and time via NTP ntpdate sets the local date and time by polling the Network Time Proto‐ col (NTP) server(s) given as the server arguments to determine the cor‐ rect time. It must be run as root on the local host (unless the option -q is used). A number of samples are obtained from each of the servers specified and a subset of the NTP clock filter and selection algorithms are applied to select the best of these. Note that the accuracy and reliability of ntpdate depends on the number of servers, the number of polls each time it is run and the interval between runs. ntpdate can be run manually as necessary to set the host clock, or it can be run from the host startup script to set the clock at boot time. This is useful in some cases to set the clock initially before starting the NTP daemon ntpd. It is also possible to run ntpdate from a cron script. However, it is important to note that ntpdate with contrived cron scripts is no substitute for the NTP daemon, which uses sophisti‐ cated algorithms to maximize accuracy and reliability while minimizing resource use. Finally, since ntpdate does not discipline the host clock frequency as does ntpd, the accuracy using ntpdate is limited.
You can do so with
sudo ntpdate TIME-SERVER
TIME-SERVER lists can be founded here
Ubuntu synchronises with the
ntpdate utility once each time the network connection comes up (which usually happens when you boot).
This utility is installed by default, but only runs when Ubuntu calls it and does not stay running in the background as a daemon.
ntp package installs the NTP daemon. The ntp daemon allows for the time to be continually synchronised while the system is running.
Update: in recent versions of Ubuntu (eg 16.04)
ntpdate is replaced by
timedatectl, which synchonises once on boot as well as when a network comes up, but does not keep running at other times. See https://help.ubuntu.com/lts/serverguide/NTP.html for more.
For those of you with 16.04 LTS time sync appears to be handled by sytemd specifically "timedatectl"
timedatectl status Local time: Wed 2016-11-30 17:45:18 CST Universal time: Wed 2016-11-30 23:45:18 UTC RTC time: Sun 2016-12-04 06:50:39 Time zone: America/Chicago (CST, -0600) Network time on: yes NTP synchronized: yes RTC in local TZ: no
Note also that it is entirely possible for there to be a front-end interface, to a service which is not installed.
You can change the settings in that front-end (GUI) interface all you want, but if the service that actually performs the tasks isn't installed, nothing will happen.
Note however, that I think the "switch" is valid because it tells it to do the one-time update at EACH boot. (or to not do so).
Unless this is a not-network connected system, or there is some other overriding reason to NOT have its time set to match "standard" time, I would strongly urge you to install ntpd, and properly configure and run it.
Ubuntu comes with ntpdate as standard, and will run it once at boot time to set up your time according to Ubuntu's NTP server. However, a system's clock is likely to drift considerably between reboots if the time between reboots is long. In that case it makes sense to correct the time occasionally. The easiest way to do this is to get cron to run it every day.
For some reason, on 16.04, Maythux's answer doesn't work straight away.
But taking the lead from there, this worked for me.
$ sudo ntpdate-debian
Please note that it requires
sudo privilege, obviously.
Under the hood, it uses
ntpdate tool, differing only the config file.
ntpdate-debianis identical to
ntpdate(8)except that it uses the configuration in
/etc/default/ntpdateby default. ntpdate sets the local date and time by polling Network Time Protocol (NTP) servers.
Well the later Ubuntu releases often do it using chrony which is an alternative implementation of ntp with some differences:-
See https://chrony.tuxfamily.org/ for more information.