建议你返回相减后的天数吧。// showmessage(DateToStr(now)+'  '+DateToStr(FileDateToDateTime(I))+'  '+inttostr(trunc(now-FileDateToDatetime(I))));//注释掉
  button2.Caption :=inttostr(trunc(now-FileDateToDatetime(I)));

解决方案 »

  1.   

    或者如下,我试过了可行:
    // showmessage(DateToStr(now)+'  '+DateToStr(FileDateToDateTime(I))+'  '+inttostr(trunc(now-FileDateToDatetime(I))));//注释掉
      button1.Caption :=datetostr(now-FileDateToDatetime(I));
      

  2.   

    其实,你的方法是正确的,可惜没有真正理解!日期是以浮点型表示,12/30/1899 12:00 am为0基准DateToStr(now-FileDateToDatetime(I))可以改为IntToStr(Round(Now-FileDateToDatetime(I)))