Jump to content
  • Windows 10 Forums

    Welcome to the Windows 10 forums, a free community where people just like you come together to discuss, share and learn how to use their computers.

    As a guest, you can browse and view all the content on the site, however, you won't be able to leave comments or create new topics unless you create a free account. 

How to detect reset of RTC time in Windows 10


tomas_86

Recommended Posts

I have tablet that is used as Medical device where is running software that I am developing. I need have always actual time in my application.

Tablet do not contain CMOS battery so  RTC time will restarted when batery is empty. 

Tablet is aslo not connect to the internet so time synchronization via internet is not possible. 

 

I need some notification from Windows to know that RTC time in BIOS was restarted. So I can ask user in me application to enter new time/date. 

I suppoused that when RTC reset happened there will be default time and this default time will be used aslo in Windows but as I read  for Windows 10 it does not work .  

(https://learn.microsoft.com/en-us/troubleshoot/windows-client/shell-experience/changes-calendar-date-in-bios-not-reflected)

 

1. Is there some background solution in Windows 10 how to know that RTC time was restarted ? ( some value in registry, some logs in windows,... ) 

2. Is there some way how to use restarted RTC time in Windows 10 ?  

During normal behaviour during Windows 10 startup:

if (RTC time > Windows system time) => RTC time us used in Windows

if (RTC time < Windows system time) => Windows keep system time and aslo set RTC time

3. Is there some way how to block Windows 10 to set RTC time when RTC time was restarted ( or is older that Windows time) ? I tried to block service "Windows Time" but RTC time is still updated.

In this point I am thinking to disable time synchronization between RTC and Windows time and check directli this time to evaluate if RTC time was restarted (RTC time is older than Windows time)

4. I found on internet that Windows use  function "clock_systohc" to set RTC clock

(https://learn.microsoft.com/en-us/azure-sphere/reference/applibs-reference/applibs-rtc/function-clock-systohc)

Is there any way to know that this fuction was called ?

 

Thanks

Link to comment
Share on other sites

  • 4 weeks later...

Windows 10 relies on the system time maintained by the operating system, rather than the RTC time, for most time-related operations. However, you can use the command line tool "tzutil.exe" to set the system time to the value of the RTC time. Open a command prompt with administrative privileges and run the command "tzutil.exe /s your_RTC_time", where "your_RTC_time" is the new time you want to set. Keep in mind that changing the system time in this way can have unintended consequences and may affect the behavior of other applications.
 

Regards,
Jimmy

Link to comment
Share on other sites

Thanks for solution

 

We already have different solution.

We ask to update BIOS that will be set to year 2099 after reset  => when Windows 10 detect year 2099 it will use it because it is bigger than actual year => in our C# aplication we can detect that restart happened by comparizon that year is 2099

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Who's Online   0 Members, 0 Anonymous, 4 Guests (See full list)

    • There are no registered users currently online
×
×
  • Create New...