Set TimeZone

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



After I use the code in the OpenNETCF Smart Device Framework to set the timezone, the TimeZone.CurrentTimeZone.GetDaylightChanges() no longer returns correct dates, even after restarting the application.

code looks pretty much like this:

TimeZoneCollection tzColl = new TimeZoneCollection();
tzColl.Initialize(TimeZoneCollection.ALL_TIMEZONES_LIST);
for (int i = 0; i < tzColl.Count; i++)
{
TimeZoneInformation tzi = (TimeZoneInformation)tzColl[i];
if (tzi.StandardName == "W. Europe Standard Time")
{
DateTimeEx.SetTimeZoneInformation(tzi);
}
}

But obviously this is not enough. Any ideas on how to get the DaylightChanges back to working?

Martin K

EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.com
.



Relevant Pages

  • Re: changing the timezone on a live system
    ... Anything I could possibly force through mdb etc.. ... there is no way to reset those environment variables without stopping and restarting every process. ... You may be able to solve your problem by stopping and restarting a few processes where the timezone really matters. ...
    (comp.unix.solaris)
  • Re: changing the timezone on a live system
    ... there is no way to reset those environment variables ... without stopping and restarting every process. ... processes where the timezone really matters. ...
    (comp.unix.solaris)