给一段代码,我已经测试过了,给分吧!<br>procedure TForm1.Timer1Timer(Sender: TObject);<br>var yy,mm,dd,h,s,m,ms:word;<br> sys_time:systemtime;<br>begin<br> //Edit1.Text:=formatdatetime('YYYY-MM-DD HH:nn:ss:zzz',now());<br> decodedate(now(),yy,mm,dd);<br> decodetime(now(),h,s,m,ms);<br> sys_time.wYear := yy;<br> sys_time.wMonth := mm;<br> sys_time.wDay := dd;<br> sys_time.wHour := h;<br> sys_time.wMinute := s;<br> sys_time.wSecond := m-1;<br> sys_time.wMilliseconds := ms;<br> setlocaltime(sys_time);<br>end;