I have a really big problem with the time on windows 10. Every time I start computer, I have to manually set the correct time. I don't know what the problem is. In settings "Set time automatically" is enabled. Also, I changed startup type of Windows Time service to automatic. Nothing helped me. Maybe it will be useful information, I have two OS on the computer: Windows 10, Ubuntu. Moreover, the time doesn't update only if I used Ubuntu before starting Windows 10.
-
1Time is controlled by your BIOS/UEFI and is kept active by a battery. If the battery is dying then the time and date could reset to a specific number. But it is more likely that Ubuntu is somehow changing the time. – LPChip Nov 11 '17 at 19:34
-
@LPChip I understand. But on Ubuntu time is correct every time I launch it. Maybe there is a way to automatically update the time through the internet on Windows 10 when I start it? – irakliy01 Nov 11 '17 at 19:39
-
Are you able to ping your NTP Server? – Ramhound Nov 11 '17 at 19:48
-
1When the time is incorrect, what is the value? Is it like an hour off, a few minutes off, or specific: 0:00? Also, is the date off too? – LPChip Nov 11 '17 at 19:59
-
@Ramhound, [pastebin](https://pastebin.com/qULtU8Ks) - is this information helpful? I don't know how to ping my NTP server, because I don't know what domain it has – irakliy01 Nov 11 '17 at 20:08
-
@LPChip, most often the time lags behind for a couple of hours. The date is always correct – irakliy01 Nov 11 '17 at 20:13
-
Are you using the default Windows NTP provider? If you cannot ping, time.windows.com, then that’s the source of your problem. – Ramhound Nov 11 '17 at 20:39
-
@Ramhound, yes, I am – irakliy01 Nov 11 '17 at 20:41
-
Is it exactly that many hours off? Sounds like the timezone might be off. – LPChip Nov 11 '17 at 21:06
-
@LPChip, minutes are wrong too. For example, now it shows 23:11 but in Moscow it is 00:13. I set time zone manually to UTC+03:00. It didn't help – irakliy01 Nov 11 '17 at 21:13
-
If you change your NTP provider to something other then time.windows.com does the behavior you describe still happen? – Ramhound Nov 11 '17 at 22:50
-
@Ramhound, no, it didn't help. For some reason in services Windows Time is now set to Manually – irakliy01 Nov 12 '17 at 22:05
-
So set it to automatic – Ramhound Nov 13 '17 at 02:10
2 Answers
Most probably Linux tries to keep your hardware clock as UTC. It recalculates to the desired timezone every time it's needed. This makes the hardware clock independent of timezone, particular OS, DST etc. Two OS-es with different timezone settings may peacefully coexist, if only they agree the hardware clock is UTC.
Windows on the other hand annexes hardware clock to itself. It uses local time and expects hardware clock to be set according to it. Two such impertinent OS-es with different timezone settings will constantly struggle over a hardware clock. And because Linux tries to keep it as UTC, it will also struggle with Windows, unless local time in Windows should match UTC (but in your case it should not).
There are few ways to deal with this. Pick one:
Let every OS synchronize via NTP on its own and set the hardware clock back and forth. Until NTP daemon/service kicks in, the system clock may be off. If the daemon/service fails to do its job, the system clock may be off. Your comments make me believe your Windows Time Service doesn't start at all; it should start automatically. I guess the time is off also when you start your Ubuntu, but Linux gets the clock right via NTP before you know it.
Make Windows support UTC as hardware time. See this answer to relevant question. Note it requires you to stop Windows Time Service.
Make Ubuntu use local time as hardware time. According to this answer:
Check that
/etc/adjtimeis configured correctly. The third line must containUTC(exactly these three characters) if the hardware clock uses UTC, and something else (e.g. empty) if the hardware clock uses local time (in the time zone defined by/etc/timezone).Obviously timezone settings on both OS-es should match. I believe with this method you can keep syncing via NTP on one OS or both of them.
Edit
The third way requires there is /etc/adjtime. If there's not one in your Ubuntu then I believe this answer gives the right hint:
If file
/etc/adjtimeis not present, systemd assumes the hardware clock is set to UTC.The hardware clock can be queried and set with the
timedatectlcommand. To change the hardware clock time standard to localtime, use:sudo timedatectl set-local-rtc 1If you want to revert to the hardware clock being in UTC, do:
sudo timedatectl set-local-rtc 0These will generate
/etc/adjtimeautomatically and update the RTC accordingly; no further configuration is required.
- 69,815
- 22
- 136
- 202
@echo off
net start W32Time
W32tm /resync /force
echo Sync Successful
Copy and Paste the above in Notepad
1. Save it as filename.cmd
2. Right-Click on this File and Create Shortcut
3. Right-Click on the Shortcut file
4. Click Properties
5. Click Advanced
6. Check the box Run as Administrator
7. Click Apply
7. Click OK
Copy the shortcut file to the Desktop and double click it after startup
NOTE!: You need an active internet connection