The time on the clock is wrong ubuntu 14.04

I just did a fresh install of Ubuntu 14.04 on my Lenovo G50-70 yesterday, removing windows 10. When I boot up the machine, the clock was showing the wrong time, even though the timezone was correct. The clock was running ahead by three hours. How do I fix the clock?


Solution 1:

Check this for details about setting up NTP synchronization.

UbuntuTime

From the above page:

Command Line ntpdate

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. With your favorite editor, create (needs sudo) a file /etc/cron.daily/ntpdate containing:

#!/bin/sh
ntpdate ntp.ubuntu.com

Make sure that you make this new file executable:

sudo chmod 755 /etc/cron.daily/ntpdate

Solution 2:

I got a workaround. I used the following command to set the hardware clock to correct date and time:

sudo hwclock --set --date "mm/dd/yyyy hh:mm:ss"

and then used the following command to sync it with system clock:

sudo hwclock -s

I logged out and back in, and the problem was solved.