Re: using IdDayTime to get time

Giganews Newsgroups
Subject: Re: using IdDayTime to get time
Posted by:  Jorge Almeida (Jorge@do.not.spam.me)
Date: Wed, 16 Apr 2008

David Edwards wrote:

> I tried to find an example of IdDayTime to get the time from an external
> time server with no luck. (Delphi 2007)
>
> I drop a TLabel and a TIdDayTime on a blank form and set its host to
> time.windows.com and leave the port to 15 (I tried port 1 also, per net =
time
> /querystnp).
>
> In the Label1's OnClick, I have:

I didn't have experience with TIdDayTime component, but consider to use =
IdSNTP component:

      IdSNTP1.Host :=3D 'time.windows.com';
      IdSNTP1.Connect;
      IdSNTP1.SyncTime;
      IdSNTP1.Disconnect;

This working with sufficient user privleges to adjust time

--
Jorge

Replies

None

In response to

using IdDayTime to get time posted by David Edwards on Tue, 15 Apr 2008