Changing system date/time

  • Thread starter Thread starter Joshua Moore
  • Start date Start date
J

Joshua Moore

The devices we're using are frequently losing their IP and date/time, and
without waiting for a resolution, I'd like to set the date and time when I
ping the web Server (date/time included in my ping function). Any easy way
to set the system date and time in C# on dotNetCF?

Thanks,
Joshua Moore
 
Are there any good samples/articles on how to set time, timezones and local
settings with the SDF? The docs are a bit sparse...

For instance, how do you know what settings you need to add to a
TimeZoneInformation to set it to Central European Standard Time or GMT+1? Or
any other timezone for that matter :-)

thanks,

Peter
 
The time zone situation, if you follow any of the old threads on this
newsgroup via Google, is rather bad on the PPC. Somewhere, there is the
information which is used to display the selection information for the time
zones in the control panel, but it's not in the same location as it is in
the Windows CE (non-PPC), case. The OpenNETCF code has the ability to
enumerate the time zones, extract the 'bias' values, and select a new time
zone, but it will presently only work on non-PPC devices. If you figure out
where the information is stored on PPC, *let me know*, so I can adjust the
code.

If you are running on PPC and for some reason you can't just tell the user
to open the control panel and change the settings manually, you'll have to
figure out the entries for the SetTimeZoneInformation() call yourself. Most
of them are pretty clear. Here are the right ones for the Central European
time zone at GMT+1 (Sarajevo, Warsaw, etc.):

-----

Bias = -60
StandardName = "Central European Standard Time"
StandardDate:
wYear = 0
wMonth = 10
wDayOfWeek = 0
wDay = 5
wHour = 3
wMinute = 0
wSecond = 0
wMilliseconds = 0
DaylightName = "Central European Daylight Time"
DaylightDate:
wYear = 0
wMonth = 3
wDayOfWeek = 0
wDay = 5
wHour = 2
wMinute = 0
wSecond = 0
wMilliseconds = 0
DaylightBias = -60
 
Back
Top