SetSystemTime

  • Thread starter Thread starter =?ISO-8859-1?Q?Linus_R=F6rstad?=
  • Start date Start date
?

=?ISO-8859-1?Q?Linus_R=F6rstad?=

Hello!

I'm having problem using the SetSystemTime function to set the time on
my PPC 2003 device. The problem is that when the time is set it will
display the wrong time in pocket pc but the right time in DateTime.Now.
I have tried the same on my XP machine and there everything's fine and
if I use the SetLocalTime on the deivce the right time is displayed and set.

Can anyone explain why it's like this? I have tried it on two different
PPC 2003 devices.

Sincerly
Linus
 
Do you have the same timezone and daylight savings settings on device and XP

Peter
 
You might want to try using SetLocalTime. Timezone is important when
doing this. I remember getting this to work and it was nasty. I will
post my code after I hunt it down later today.

--
Norman Rericha

Applied Data Systems
www.applieddata.net
An ISO 9001:2000 Registered Company
Microsoft WEP Gold-level Member
 
Yes I do have the same timezone and daylight savings settings. I connect
to a sntp server to get the correct time. The time I get back is in UTC
format which I send to the SetSystemTime. If I get the time 12:05 UTC
which would be 13:05 for my timezone, the time displayed by PPC is
04:05. That's a big difference.

How come the cf returns the right time but the OS is displaying the
wrong time?

Sincerly
Linus
 
Try, just as a test, calling SetLocalTime() and see if the right time is
displayed. If so, then the problem *is* the timezone and you need to
carefully examine the settings. If the right time still is not displayed,
I'd guess that something is wrong with how you are calling SetSystemTime()
(maybe your P/Invoke declaration is wrong, for example).

Paul T.
 
Back
Top