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);
end;