If it's a server, use ntpd. For ubuntu, install that with:
sudo aptitude install ntp
The way you can check on it is through the
ntpq program. use it something like this:
remote refid st t when poll reach delay offset jitter
europium.canoni 18.104.22.168 2 b 48 64 377 141.805 42.254 9.901
This tells you that it's synced up with one host, and that it's about 42 milliseconds off from it. If it isn't syncing up, you might see a reach like 0, which means it can't connect to your designated host. You also might see a giant offset; NTP gets scared when it sees too big a time difference, and so you'll have to set the clock manually with ntpdate first, with something like
sudo ntpdate tick.usno.navy.mil.