同步系统时间:
var
dtm:TDateTime;
dm:TSystemTime;
begin
with ADOQuery_server do//服务器
begin
close;
sql.Clear ;
sql.Text :='Select GetDate() as Servernowdatetime';
open;
dtm:=FieldByName('Servernowdatetime').AsDateTime;
Close;
DateTimeToSystemTime(dtm,dm);
if(not SetLocalTime(dm))then
begin
showmessage('ok');
self.ModalResult :=mrcancel;
exit;
end;