Windows clock issues

Sorry guys, this post is about Microsoft Windows in a Linux tech community, please don’t kick me out :smiley:


Recently I discovered that Windows system clock both in Windows 10 and in Windows 11 is going behind for several seconds over time.
One day I opened a website displaying the universal unix timestamp, synchronized to my regional timezone and I compared it with the Windows clock. I notice that Windows clock was gradually getting slower, initially for some seconds, after a long period it could fall behind by 20-30 seconds.
To investigate I manually synchronized Windows clock with Microsoft server time time.windows.com, usinig the option in Windows taskbar. At that moment system clock was perfect, synchronized at second. However, after some time, it started lagging again.

How I fixed it:

The custom solution I found involves creating a scheduled task to automatically synchronize with Microsoft server the system clock every 10 minutes.
Here’s what I did:

  1. Started the “Windows Time” service
  2. Created a scheduled task to sync the time every 10 minutes
    • Trigger: at user login
    • Repeat every: 10 minutes
    • Repeat: indefinitely
    • Action: run the system command w32tm /resync
      • Program or script: w32tm
      • Program arguments: /resync
        In the general tab of task configuration make sure to enable: “Run with high elevated privileges”

This is the only fix I found, I implemented on my Windows system and now the clock is everytime syncronized.
And you? Did you ever notice this annoying issue on Windows?
If you found this post useful, feel free to leave a comment and share your experience! :blush:

1 Like

Unfortunately, this is not unusual.
As far as I know, this can also have to do with standby / hibernate settings. But I can’t give any specific tips, I’ve never been affected myself.
It only gets really funny with a dual boot setup windows / linux.

1 Like

For dual boot with Linux this might be a problem where you will be behind about 1 hour in Windows :smiley: but there’s a regedit fix for this, it’s not so difficult to manage.

About stanby / hibernate settings I would say no because my computer using Windows is configured with the ultimate profile, so it will never hibernate neither turn off hard drive or monitor. I’m encountring this issue just only using the PC, while coding or surfing the web after a couple of hours the system clock start lagging. :slight_smile: that’s what I discovered by keeping computer turned on for long period (more then 10 hours day)

1 Like

Interesting :thinking: bug. The only time issue I have ever seen is if a computer is on a domain and the domain server is out of sync.

I have seen time go out of sync gradually over a month, but never in a few hours. High CPU usage a cause? I wouldn’t think so, as the computer usability would be affected first before a lag in time.

At this point, without doing research, I would wonder if it’s hardware related. CMOS battery getting weak?

I am curious to do a search on it.

So I did a Google Search on “windows system clock lagging”
and what the AI suggested is to check the CMOS battery or their might be another hardware issue.

Questions to ask: How old is your computer? Are you seeing other weird issues?

1 Like

Ehiho @shybry747

I am talking about the Windows clock in few hours it’ll be lagging for a couple of seconds, you cannot notice the difference, until you compare it with the Unix timestamp.

My PC is quite recent, from 2019, I’m sure CMOS battery is running fine and the CPU (a Ryzen 5800x) usage is absolutely normal, there’s not any software or malware or services running in background, I also debloated the entire system for strip telemetry and useless bloat :slight_smile:

Weird thing is: on Linux I can’t see any problems, the clock is working perfectly. It’s only when I’m using Windows that I’m seeing this artifact. I tried ask Chat GPT it told me Windows clock might have some issues, but it’s not a well common bug. It said some users enconter this problem, some others no. It might be specifically hardware related, so I asked you to compare Windows clock with Unix timestamp for see if I’m just unlucky with my hardware or if someother are in the same boat.

I have a computer which is setup for dual boot. It has on Windows 10, and vanilla Arch with Budgie. The Arch boot menu allows me to choose which OS to boot into.

I started the computer, booted into Windows and observed the time was just a little fast by a few seconds.

I restarted it and booted into Arch. I immediately opened a terminal and used the date command to check the time. It showed 28 seconds past the minute. I executed the date command again right after, and then it showed 19 seconds past the minute.

So I did a little research on time synchronization in Linux and Windows.

The Arch Wiki systemd-timesyncd - ArchWiki tells me that timesyncd is used. When I used the command timedatectl timesync-staus it reported an interval of a maximum of 34 mins. And of course upon starting it would correct the time, hence the result above.

When I google timesync for Windows 10 it tells me the default interval is 1 week. :man_facepalming: However, when I did a manual timesync on my Windows computer and checked for the next interval it gave me about 9 hours.

I found this article How to Change the Time Synchronization Interval in Windows that shows how to modify the registry to change that synchronization. I looked up that value and saw it was 8000 hex or 32768 dec which works out to be 9.1 hours. Therefore a 30 minute interval will work out to 708 hex. I had to do a manual sync update before it picked up the new interval.

So in summary we have your solution to schedule a task, which plenty persons suggest. Second we can modify the registry so that the windows service can sync faster. I do think your solution maybe better, as the default windows time service can be iffy sometimes.

1 Like

Here is a little bit more background info why this happens:

https://www.howtogeek.com/323390/how-to-fix-windows-and-linux-showing-different-times-when-dual-booting/

2 Likes

@shybry747

Thanks for your researches :pray:
I’m also now using a dual boot system, Windows 10 in one hard drive and a Linux distro on other disk (for now POP!_OS).
For what I said on my case every distribution I tried installing the time is perfectly synced with Unix timestamp, on Windows I’m observing that odd problem about it’s lagging.

I did not know about regedit specific key, I was pretty sure there was a dedicated section on Windows register for this problem, but I never went deeph into this. Thankyou for explain, I might give a look next days.

Btw yes I think the solutikon with the Windows scheduler might be a better solution because it will sync the time istantly and boom: you are ok. The only thing is you need to configure your timezone before syncing the time, in my case I need to use the Europe/Berlin/Amsterdam/Vienna timezone.
With regedit you need to put more effort and make some more tries before being sure that the clock is properly working.


@toadie
Yes that’s a good point, I know that is necessary to edit some other keys in Windows register for dual boot date sync time, for letting Windows PC using Universal Time.
In my case I’m not experiencing this issue because I already edited that key with a script, the problem I’m having only using Windows regardless having or not another disk or partition with Linux. The problem I notice is specific only with Windows usage.

2 Likes