已经解决,代码如下:
procedure TForm1.ClientSocket1Read(Sender: TObject;
Socket: TCustomWinSocket);
var
TempTime: TDateTime;
hh,mm,ss,ms: word;
sTime : string;
begin
sTime := Socket.ReceiveText; // 取得54046 06-11-07 11:51:11 00 0 0 9.9 UTC(NIST) *
sTime:=Copy(sTime,8,8); // 取得时间部分;
Edit1.Text :=sTime;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
ClientSocket1.Host :=Edit2.Text; //输入"Time.nist.gov"
ClientSocket1.Port :=13;
ClientSocket1.Open;
end;