Procedure Timer1Timer(sender)
Begin 
 Statusbar1.panels.items[2].text:=Datatimetostr(Now);
End;

解决方案 »

  1.   

    给你做个DEMO吧。自己看。
    第一步:在FORM上放一个DELPHI自带的TIMER控件,Button1,button2
    7个LABEL.
    BUTTON1的点击事件;
    begin
    timer1.enabled:=True;
    end;
    BUTTON2的点击事件
    begin
    timer1.enabled:=false;
    定义:
    Procedure TForm1.Timer1Timer(Sender:TObject);
    Var
      datatime:tdateTime;
      Year,Month,Day,Hour,Min,Sec,MSec:word;
    begin
       DateTime:=Now;
       DecodeDate(DateTime,Year,Month,Day);
       Label1.caption:='Year:'+Inttostr(year);
       Label2.caption:='Month:'+Inttostr(Month);
       label3.caption:='day:'+Inttostr(day);
       
        Decodetime(Datatime,hour,min,sec,msec);
        label4.caption:='Hour:'+Inttostr(hour);
        label5.caption:='min:'+Inttostr(min);
        Label6.caption:='sec:'+Inttostr(sec);
        Leabl7.caption:='Msec:'+Inttostr(MSEC);
    END;
      

  2.   

    time:系统时间
    date:系统日期
    在SysUtils中定义