How to quickly solve the problem by aligning the time to both operating systems
The underlying problem is that Ubuntu and Windows read the system time differently. Ubuntu does this in UTC format, while Windows does it in local format. This means that every time we fix the time in one of the two operating systems, by switching to the other we will end up with the altered time.
We will solve the problem by telling Windows to read the time in UTC format, and no longer in local.
First, you need to disable automatic time update in Windows settings, after which you just need to open regedit to edit the registry, go to the location
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation
and create a new 32-bit DWORD with name RealTimeIsUniversal and value 1 hexadecimal, as in the cover
At the next restart the time will no longer be out of phase and will respect the one set by Ubuntu.