10

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?

7 Answers 7

12

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
7

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.

0

If your computer has only Ubuntu installed, you should change the hardware clock (in the BIOS or whatever your computer uses) to UTC time, as this is how Ubuntu expects it. Right now, it is probably set to your local time, since that is how Windows expects it.

2
  • How do I change the hardware clock? can you suggest the methods? Dec 31, 2015 at 1:23
  • This depends on your computer, usually there is some sort of "press [key] to enter setup" message on the boot screen.
    – fkraiem
    Dec 31, 2015 at 1:44
0

Goto NTP and check your zone for ntp server. Then, type the following to set it to your zone:

sudo service ntp stop
sudo ntpdate -s YOUR TIME ZONE SERVER ADDRESS
sudo service ntp start

This should update and correct your time.

1
  • didn't work at all Apr 18, 2016 at 10:40
0

Answered by utamav: This is a common problem when dual booting with Ubuntu/Linux. Linux gets it's time from BIOS assuming it is UTC while Windows does it assuming it is your regional time. So each OS keeps messing the time for each other. The easier way is to change time in Linux. In linux, go to:

/etc/default/rcS

Change:

UTC=yes to UTC=no
0

For me none of the above worked. The solution I found here worked for me: $ ln -sf /usr/share/zoneinfo/America/Los_Angeles /etc/localtime

0

try this out, it worked for me. open system setting, choose time&date, try changing zone and revert back to your timezone. This surprisingly seems to work on my local system.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .