Restore date/time settings after clearing the registry

Hello,

we have some problems restoring the date/time settings after clearing the registry.

What we are doing now is:

  • make backup of some registry settings (see below)
  • clear registry (Upd_RegistryClear)
  • reboot
  • restore registry settings
  • save registry (Upd_RegistrySave)
  • reboot

Timezone and daylight saving settings are restored correctly, but the time is not correct.

  • When the timezone “(UTC) Coordinated Universal Time” is set, the time is off by -8 hours.
  • When the default timezone “(UTC-08:00) Pacific time (US & Canada)” is set, the time is correct.
  • When the timezone “(UTC+01:00) Amsterdam, Berlin, …” is set, the time is off by -9 hours.

How do we restore the date/time settings correctly?
Do we have to call “rtcsync” after restoring the registry keys?

These are the date/time related registry settings we are saving/restoring:

[HKEY_LOCAL_MACHINE\Software\Microsoft\Clock]
"AutoDST"=dword:00000001

[HKEY_LOCAL_MACHINE\Time]
"TimeZoneInformation"=hex:5C,FE,FF,FF,57,00,2E,00,20,00,4D,00,6F,00,6E,00,67,\
  00,6F,00,6C,00,69,00,61,00,20,00,53,00,74,00,61,00,6E,00,64,00,61,00,72,00,\
  64,00,20,00,54,00,69,00,6D,00,65,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,09,00,05,00,05,00,17,00,3B,00,3B,00,E7,03,00,00,00,00,57,00,2E,00,\
  20,00,4D,00,6F,00,6E,00,67,00,6F,00,6C,00,69,00,61,00,20,00,44,00,61,00,79,\
  00,6C,00,69,00,67,00,68,00,74,00,20,00,54,00,69,00,6D,00,65,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,03,00,06,00,05,00,02,00,00,00,00,00,00,\
  00,C4,FF,FF,FF
"TZID"=dword:00000785

The registry keys were taken from Time and Date Registry Settings (Compact 2013).

In case your a wondering why we want to do this: This is part of our application update process.
Our appliation is integrated in the OS Image, so we have to update the OS whenever we want to update our application. We’d like to reset all registry keys to the default values, except those which might have been changed by our application. The only way i see is to backup “our” registry settings, update the os, clear the registry and restore “our” registry settings after a reboot.

Or is there an easier way?