临时写一个函数给你, 已测试,没问题
function SetSystemtime(ATime: TDateTime) : boolean;
Var
ADateTime:TSystemTime;
yy,mon,dd,hh,min,ss,ms : Word;
Begin
decodedate(ATime ,yy,mon,dd);
decodetime(ATime ,hh,min,ss,ms);
With ADateTime Do
Begin
wYear:=yy;
wMonth:=mon;
wDay:=dd;
wHour:=hh;
wMinute:=min;
wSecond:=ss;
wMilliseconds:=ms;
End;
Result:=SetLocalTime(ADateTime);
SendMessage(HWND_BROADCAST,WM_TIMECHANGE,0,0)
If Result then ShowMessage('成功改变时间!');
End;