Home All Groups Group Topic Archive Search About

GetSystemTime or GetLocalTime

Author
7 Mar 2006 5:50 PM
Chris
I'm synchronising times amongst a number of clients via a TCP connection.
(I'm in the UK).  The correct time will be read from GetSystemTime or
GetLocalTime.  The structure is sent to the remote client via TCP and the
client uses SetSystemTime or SetLocalTime.

Should I be using GetLocalTime & SetLocalTime?  My client logs the old and
new time so I assume the using Local would be best?

Author
7 Mar 2006 8:48 PM
Tom Esh
On Tue, 7 Mar 2006 17:50:12 -0000, "Chris" <chrisx@NOSPAM.com> wrote:

>I'm synchronising times amongst a number of clients via a TCP connection.
>(I'm in the UK).  The correct time will be read from GetSystemTime or
>GetLocalTime.  The structure is sent to the remote client via TCP and the
>client uses SetSystemTime or SetLocalTime.
>
>Should I be using GetLocalTime & SetLocalTime?  My client logs the old and
>new time so I assume the using Local would be best?

Definitely system time. Otherwise you'll be dealing with the whole
timezone conversion madness. Even if all the clients are in the same
TZ, I'd still go with system. Either way I suspect you'll find out
rather quickly just how many clients are not configured for the
correct local TZ <g>


-Tom
MVP - Visual Basic
(please post replies to the newsgroup)