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.
For servers and machines that run for long time before reboot is better to use NTPD.
sudo apt-get install ntp
Now edit the file /etc/ntp.conf putting the NTP servers you want to synchronize with. I’m putting my Windows domain controllers as time-server.
Restart NTP service and check now with this command the servers with which you are synchronized.
sudo ntpq -np
A star by any one of the chosen server names means that the system clock is synchronizing with the NTP clock.