timer不能取系统时间
它只是一个定时器,是用相对时间来触发时间的
可以用GetSystemtime
或者date,now等函数来取得系统时间

解决方案 »

  1.   

    1899-12-30是DELPHI是从1899-12-30:00:00开始计算时间的
      

  2.   

    var
      hour,min,sec,msec:word;
    Decodetime(now,hour,min,sec,msec)
      

  3.   

    delphi的timer可以取系统时间 
      

  4.   

    datatimetostr(time);
    就这样啊,TIMER不能取时间吗,那我取的时间是从那来的!???
      

  5.   

    SysUtils.pas中有Time函数的说明,其实你所取的时间就是由这个函数得来的。按住ctrl,鼠标点击
    datatimetostr(time);中的time,delphi会自动打开SysUtils单元。你会看到这个函数的定义:
    function Time: TDateTime;
    var
      SystemTime: TSystemTime;
    begin
      GetLocalTime(SystemTime);
      with SystemTime do
        Result := EncodeTime(wHour, wMinute, wSecond, wMilliSeconds);
    end;
    注意这里的SystemTime只是一个当前时间,并没有日期的信息。所以你可以想象1899-12-30这一天
    可能就是系统所能表示的最早时间。
      

  6.   

    Timer只是一个定时器,它的OnTimer事件作用是每隔interval毫秒数做一个动作。好象并没有取
    当前时间的作用。取当前时间就用Now吧。那句话就写成:DataTimeToStr(Now);
      

  7.   

    procedure TForm1.Timer1Timer(Sender: TObject);
    var
      DateTime : TDateTime;
      str : string;
    begin
      DateTime := Time;  // store the current date and time
      str := TimeToStr(DateTime); // convert the time into a string
      Caption := str;  // display the time on the form's caption
      { Note This could have been done with the following line of code:
        Caption := TimeToStr(Time); }
    end;