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.
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.
- 81,893
@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