TimeZone conversion and utils on PPC

G

Guest

Hi

We use PInvoke on "Kernel32.dll" to do some TimeZone conversion, Daylight
savings helpers, etc on our desktop applications.
I found out that there are no equivalent functions for these on PPC in
"CoreDll.dll". Is there any implementation of any of the following functions
on PPC?
- SystemTimeToTzSpecificLocalTime
- TzSpecificLocalTimeToSystemTime

Or are there any PPC alternatives for converting Times to and from UTC and
Local including taking into account any Daylight offsets?

TIA
Partha.
 
P

Paul G. Tobey [eMVP]

SystemTimeToLocalTime and LocalTimeToSystemTime are both available. Since
local time always takes into account the current time zone, state of the DST
flag, etc., they should do what you want. I've never seen the functions
that you mention there. The only difference is that you can't do the
conversion for an arbitrary time zone; it has to be the currently-set one.

Paul T.
 
G

Guest

oops - I missed mentioning our motivation to do that manual conversion in my
initial post:
The only difference is that you can't do the
conversion for an arbitrary time zone; it has to be the currently-set one.

Precisely that is what we want to accomplish. Convert to and from an
arbitrary time zone (not Local time zone).

Any ideas? I appreciate your response.
Thanks
PB.
 
G

Guest

You can get the timezone info for your "desired" zone and your local zone,
then use the difference between offsets associated with each to adjust what
SystemTimeToLocalTime gives you.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Managed Code in an Embedded World
www.OpenNETCF.com
 
G

Guest

Thanks for the response Chris. But, that is my problem, right? How do I get
TimeZone info for a non-local TimeZone? The whole point of PInvoking on the
desktop was to get this information using a WindowsTimeZoneId, and then get
the offset to convert LocalTime to that time zone. How do you do that in .NET
CF 2.0?

TimeZone class offers only one static property "CurrentTimeZone", and I am
looking for something similar to GetTimeZoneById(int windowsTimeZoneId) or
GetTimeZoneByName(string timeZoneStandardName).

Am I missing something here? If not, does OpenNetCF offer something in this
area?
Thanks!
 
P

Paul G. Tobey [eMVP]

There is no standard way to accomplish this on Pocket PC devices. If you
were on a Windows CE generic device, I could tell you, but it doesn't work
the same on Pocket PC. You'll have to do-it-yourself. You could copy the
timezone entries from the registry on, say, a desktop PC and write your own
code to read and interpret them.

Paul T.
 
P

Paul G. Tobey [eMVP]

You'd have to ask them. I would presume that .NET CF 3.5 will be closer to
..NET 3.5 than any previous version; that's the way things have been going.
It will be years before that's in ROM on Pocket PC devices, though...

OpenNETCF has a class that corresponds to this for Windows CE generic
devices, but we've never found a way to populate a list of time zones for
Pocket PC devices. It works very nicely on devices like those that the
company I work for sells, because they have all of the time zone information
for all of the known time zones in the registry.

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