并且精度怎么更好的控制?
谢先了!

解决方案 »

  1.   

    The following code retrieves the current date and time using the Windows GetLocalTime API call, and converts this value to a TDateTime value.function GetCurrentDateTime: TDateTime;var
      SystemTime: TSystemTime;
    begin  GetLocalTime(SystemTime);
      Result := SystemTimeToDateTime(SystemTime);
    end;
      

  2.   

    label1.Caption:=formatdatetime('yyyy-mm-dd hh:mm:ss',now);
    毫秒级:GetSystemTime
      

  3.   

    var
      NowTime:TTime;
    begin
      NowTime:=Time{这个函数可以返回系统时间};
      ShowMessage(TimeToStr(NowTime));
    end;
      

  4.   

    var
      sysTime:Tsystime;
    begin
      GetsystemTime(sysTime);
      lable1.capion:=inttostr(systime.wYear)+'-'+inttostr(system.wMonth);
    // if system.wYear>2000 then
         ...
    end;//还有好多属性,可以参考,比 now函数好多了~~~~~灵活~~~~~~