SetSystemTime() behaviour: Timezone jump

M

Marcel Ruff

Hi,

on my two PDAs I get the current UTC time from a server (for testing purposes the server
runs 7 minutes too fast) and i'm setting it with SetSystemTime().

The time is correctly set on my PDAs (as displayed on the PDA desktop),
(C#->Coredll.dll, Windows CE 5, CF 2)
but:

1) On my Psion after 30 sec the original Dublin GMT Timezone jumps to US Western (GMT-5).
How can this be, i don't have any code setting the timestamp after 30sec?

2) On my IPAQ it is set correctly as well, but after 30 sec it jumps back
to the original time (here the Timezone GMT-1 remains OK).

What could be the reason for such a behaviour?

Thanks
Marcel
 
J

Jeff Newman

Hi,

on my two PDAs I get the current UTC time from a server (for testing purposes the server
runs 7 minutes too fast) and i'm setting it with SetSystemTime().

The time is correctly set on my PDAs (as displayed on the PDA desktop),
(C#->Coredll.dll, Windows CE 5, CF 2)
but:

1) On my Psion after 30 sec the original Dublin GMT Timezone jumps to US Western (GMT-5).
How can this be, i don't have any code setting the timestamp after 30sec?

2) On my IPAQ it is set correctly as well, but after 30 sec it jumps back
to the original time (here the Timezone GMT-1 remains OK).

What could be the reason for such a behaviour?

Thanks
Marcel

Windows runs an NTP client on its own to keep the clock synchronized.
If you want to sync with a non-standard time server, you need to
disable this. Try running "services list" from the command line, then
disable the service listed as "timesvc". You could also just change
the registry setting "HKEY_LOCAL_MACHINE\Services\TIMESVC\server" to
be some non-existent server, though I would recommend disabling the
service entirely.
 
M

Marcel Ruff

Thanks Jeff for this insight.

I have suspected some daemon already.

HP IPAQ hw6910:
Unfortunately i cant find the mentioned registry entry (using total commander)
and on my two dos boxes (PocketCmd and PocketConsole) the command
'services' is unknown.

Any more ideas how to cope with my situation?

Thanks
Marcel
 
J

Jeff Newman

Thanks Jeff for this insight.

I have suspected some daemon already.

HP IPAQ hw6910:
Unfortunately i cant find the mentioned registry entry (using total commander)
and on my two dos boxes (PocketCmd and PocketConsole) the command
'services' is unknown.

Any more ideas how to cope with my situation?

Thanks
Marcel

Have you tried searching your device for services.exe? If it doesn't
exist, I'm not sure what else could be changing your clock. You could
also try using IOCTL to control the service, but again it it wouldn't
be running if services.exe isn't around. See
http://msdn2.microsoft.com/en-us/library/ms881011.aspx.
 
P

Paul G. Tobey [eMVP]

Would the time service change the *zone*? Seems like it would use the zone
to figure out the offset from GMT that the server that it's connecting to is
returning, but it seems strange that it would change the zone to match the
server. That would prevent you, unless you're in Mountain time, for
example, from syncing to NIST.

This sounds to me like some other application changing the time/zone, maybe
to try to sync with the cellular network. It's possible that the cellular
network isn't sending the right time zone, I guess, or maybe it is, but not
the zone that you want.

Paul T.
 
J

Jeff Newman

Would the time service change the *zone*? Seems like it would use the zone
to figure out the offset from GMT that the server that it's connecting to is
returning, but it seems strange that it would change the zone to match the
server. That would prevent you, unless you're in Mountain time, for
example, from syncing to NIST.

This sounds to me like some other application changing the time/zone, maybe
to try to sync with the cellular network. It's possible that the cellular
network isn't sending the right time zone, I guess, or maybe it is, but not
the zone that you want.

Paul T.

I was thinking the time service was responsible for issue number 2
seen. I agree, it wouldn't be changing the timezone. SNTP/NTP in
general is timezone-less (everything is sent as UTC). There has to be
some other application that is doing this.
 
P

Paul G. Tobey [eMVP]

After looking at the time service code, it looks to me like you can set the
intended time zone for the service via the registry. Maybe that's the
source of the phantom time zone... Periodically, something causes the
service to think, "Hey, it's time to update my settings." It goes and gets
everything from the registry and finds that the time zone doesn't match, so
changes it, or something...

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