Wednesday, September 11, 2013

TimeZone switch failing

Hi Folks,

If you are experiencing Time Zone switch issue under Windows Embedded Compact 7 (and other versions), you might have a careful look to this article.

I have identified that the SetTimeZoneInformation function is relying on the BiasChangeHelper function that require a Bias object to be correctly initialized. On some systems (and for now i haven't identified the root cause), the Time Zone bias is not correctly computed. This value then can be override in registry in order to provide the appropriate information to the system during its execution. The kernel is first starting the SoftRTC module, even if SoftRTC isn't enable on your system, in order to generate this bias information.
If you have installed the SharedSource for Windows Embedded Compact7, this initialization code is located in c:\wince700\private\winceos\coreos\nk\kernel\time.c file in function InitSoftRTC.

As mentioned the overloading value is retrieve from the registry and should match this value :
[HKEY_LOCAL_MACHINE\init\BootVars]
"KTzBias"=hex:01,00,00,00,E0,01,00,00,A4,01,00,00

So by adding this information in device registry, then you might be able to change the Time Zone.
If someone have accurate information on that KTzBias key, then I will be happy to update that post.

- Nicolas

2 comments:

  1. Hello!

    "SetTimeZoneInformationByID and SetTimeZoneInformation failure"

    http://social.msdn.microsoft.com/Forums/en-US/5a8ebf74-7dae-4678-b3e6-e44ce4e8e54f/settimezoneinformationbyid-and-settimezoneinformation-failure#49ed1e82-6462-4ad8-a212-11b01ad0c353

    ReplyDelete
    Replies
    1. Thanks Andrey, I get inspired by this article in order to find the solution but there is still this obscure KTzBias value to set.

      Delete