7

I have a dual boot system with Win 7 / Ubuntu 13.04. For some reason, Ubuntu resets the system time to -3 hours regardless of timezone settings. I thought that this was UTC problem, but the problem persists regardless of what is set in /etc/default/rcS.

# assume that the BIOS clock is set to UTC time (recommended)
UTC=no

If I check the timezone with date +%Z it states

UTC

However, when using the graphical user interface to check the timezone it shows that I'm in the right timezone.

Date gives me

pe 9.8.2013 13.51.52 +0000

While hwclock is the correct time

pe  9. elokuuta 2013 16.52.03  -0.516733 sekuntia

Ubuntu seems to set the BIOS time to wrong time. This happens on every boot, even after I've manually changed the time. Windows 7 does not have this problem. I could not find duplicates or solutions beyond the UTC settings.

The system is set to manual time and is not updating it from the internet. I've already tried that but it seems that it never updates so I'm stuck in the wrong time.

Braiam
  • 67,791
  • 32
  • 179
  • 269
krax
  • 124
  • 1
  • 10

4 Answers4

2

It sounds like you are in a timezone 3 hours separate from UTC, and Windows and Linux are disagreeing about what time should be stored in the BIOS.

Linux stores time as UTC in the BIOS clock.

Windows stores time as local time.

So whenever you boot Windows, it resets the BIOS clock to local time, Linux loads it and assumes it's UTC.

I was under the impression that the Ubuntu installer would detect Windows and set Linux to compromise by using local time in the BIOS... but this may not be true, or may not have happened correctly.

There are two solutions :

  • Set Windows to use UTC in the BIOS clock

This apparently has some caveats for "professional" usage but might be satisfactory from a user POV.

https://superuser.com/questions/185773/does-windows-7-support-utc-as-bios-time

  • Set Linux to use local time in the BIOS clock

Set the UTC setting in /etc/default/rcS to "no" (on Ubuntu)

Adrian
  • 5,216
  • It would be helpful if you read the problem before answering. In my question I explicitly stated that I thought that this was UTC problem, but the problem persists regardless of what is set in /etc/default/rcS. – krax Aug 10 '13 at 09:52
1

To avoid this, change time to manually instead of Automatically from the internet

enter image description here

enter image description here

Try this:

Remove/Purge ntp
Remove/Purge ntpdate
Install ntpdate
set UTC=yes in /etc/default/rcS
reboot
sudo ln -f -s /usr/share/zoneinfo/Europe/Helsinki /etc/localtime
Mitch
  • 107,631
  • That is an excellent advice, except that it was already set to manual. Sorry for not mentioning it in the post. Any other suggestions? Edit: Wouldn't that also set it to the right time, in case the time zone was right? (It is, but it is not updating to the right time.) – krax Aug 10 '13 at 07:51
  • Manual will not update from the net. Once its set, it will not update. Try changing the BIOS battery. – Mitch Aug 10 '13 at 08:28
  • If the BIOS battery was done there would be other symptoms and it would not reset to current time -3. Also, there would also be problems in Windows, not just Ubuntu. – krax Aug 10 '13 at 09:50
  • My mistake. I did not see that about Windows. What time zone are you in? Do you have NTP installed? – Mitch Aug 10 '13 at 09:55
  • It is. ntpdate -q gives me 10 Aug 10:01:19 ntpdate[5191]: no servers can be used, exiting. – krax Aug 10 '13 at 10:02
  • What is your time zone? – Mitch Aug 10 '13 at 10:03
  • Europe/Helsinki. Seems that some parts of the system use UTC time and some get the time zone right. – krax Aug 10 '13 at 10:06
  • See new info in my answer. – Mitch Aug 10 '13 at 10:11
  • $ ntpq -pn try to put the output of the following command. – Tarun Aug 10 '13 at 10:26
  • Reinstalling ntp and setting time settings to UTC seemed to fix the issue. Checking time from the Windows side showed it to be in -3 hours now, so it must be running local time. At least now all of different Linux-clocks agree with each other. Thank you for the help, @Mitch. – krax Aug 10 '13 at 10:38
  • I changed Linux to local time and now I seem to have two operating systems in sync and in correct time. – krax Aug 10 '13 at 10:47
0

This question is really old, but the answer that worked for me isn't listed so here it goes:

In the terminal:

timedatectl set-local-rtc 1 --adjust-system-clock

and then to check that it was successful:

timedatectl

It should give you a warning, because it is not preferred. You should see a line that reads RTC in local TZ:yes

Kevin Bowen
  • 19,615
  • 55
  • 79
  • 83
Edgar
  • 1
0

i am not a programmer . i failed in all the above steps. i have a dual boot with ubuntu 16.04 and genuine windows 10 (which is used rarely once in a month)

Here is what i did in windows i disabled setting time and time zone automatically and asked to update from internet.windows date issue got solved but ubuntu showed wrong time when i tried to update automatically from net. then i installed

sudo apt-get install ntp

and time got corrected but was not showing in boot

sudo timedatectl set-ntp on

finally solved that too.

now linux gurus can explain in detail what i did. For those who just want to get things running i feel this will help. I found all these from other questions and solved answers ok. so thanks to all of them again.

i discovered that i have to keep repeating these steps to keep clock healthy. Any help on finding a permanant solution?

Sreehari S
  • 21
  • 6
  • What you basically did is that you told Ubuntu to enable the ntp service which periodically syncs your machine's clock with the internet. ntp stands for "Network Time Protocol". It's exactly the same thing you did in Windows, but instead of using the UI, you used the command line. – Dan Feb 26 '21 at 15:51
  • ok thanks for the explanation. Wish more of your kind where here lol – Sreehari S Feb 26 '21 at 15:59