谢谢boy2002cn, <br>但是我一设定时间的时候,就出错,而且总是差8小时<br><br>procedure TForm1.WMTimeChange(var Msg: TWMTimeChange);<br>var<br> SysTime:TSystemTime;<br> NowTime:TdateTime;<br> NewTime:TdateTime;<br> SysNewTime:TSystemTime;<br>begin<br> GetSystemTime(SysTime);<br> NowTime:=SystemTimeToDateTime(SysTime);<br> if (-1/8640>CstmTime-Nowtime)or(1/8640<CstmTime-Nowtime) then// 其中CstmTime是我设定的时间<br> begin<br> DateTimeToSystemTime(CstmTime,SysNewTime);<br> SetSystemTime(SysNewTime);<br> end;<br>end;<br>结果显示总是差异8小时阿