Time Zone on CE Device

0 votes
asked Jan 25, 2010 by Rolf (120 points)
edited Apr 22, 2010

I have the ntp time package. How can I set the zime zone on a wince 5.0 device to GMT in VB?

Applies to: Rebex Time

1 Answer

+1 vote
answered Jan 25, 2010 by Martin Vobr (12,950 points)
edited Jan 25, 2010

The NTP protocol does not deal with time zones at all. This is why the current version of Rebex Time component includes no such functionality as well.

Fortunatelly settings of time zone should be quite easy.

  • you can call SetTimeZoneInformation via P/Invoke
  • you may set the [HKLM\Time\TimeZoneInformation][3] registry key

Please note that .NET CF loads the TimeZoneInformation into the AppDomain during creation. You may need to restart your app after setting the time zone. For details see P/Invoking SetTimezoneInformation() causes DateTime.Now to return an incorrect local time

If you need an actual VB.NET code for P/Invoking SetTimeZoneInformation please let me know by adding a comment to this answer.