TimeZones

G

Guest

I am writing a "worldclock" application and hit a very neat problem. How can
you tell that you've entered a daylight savings time period if the device
timezone does not change time during DST (I.e. Caracas, La Paz)?

methods like TimeZone.Isdaylightsavingstime(...now()) return false because
the system timezone does not use DST. If I change the device to Eastern time
it works fine but this is not wanted.

Is there a way to determine that it is daylight savings time in other areas
or that we are in the DST season programatically?
 
K

Katy King

From: =?Utf-8?B?S2FtIE1pdGNoZWxs?= <[email protected]>
|
| methods like TimeZone.Isdaylightsavingstime(...now()) return false
because
| the system timezone does not use DST. If I change the device to Eastern
time
| it works fine but this is not wanted.
|
| Is there a way to determine that it is daylight savings time in other
areas
| or that we are in the DST season programatically?

No, at this time there is no managed way to access time zones other than
the one the computer is currently in (except converting to/from UTC). You
can probably find examples to programmatically change or access time zone
information through unmanaged code.

Katy
CLR Test
 
P

Paul G. Tobey [eMVP]

If you're on a Windows CE, rather than Pocket PC, device, you can do it
yourself, as the timezone information is stored in the registry, including
when the DST transitions occur, etc. You'd have to do some interpretation
of the data, as many places transition on "last Sunday in March" or
something like that, not a specific date, but checking a few of the time
zone entries against when the transitions actually occur should tell you how
that works.

There are some classes in OpenNETCF which interact with the Windows CE
registry entries.

Paul T.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top