delphi 计算文件与当前时间差(天小时分钟秒)
来源:互联网 发布:找对象学历重要吗 知乎 编辑:程序博客网 时间:2024/05/02 04:15
procedure TForm1.FormCreate(Sender: TObject);//窗体初始化
var
iFileHandle: Integer;
FileTime:TDateTime;
Days:Integer;
Hours:Integer;
Minutes:Integer;
Seconds:Integer;
begin
DataPath := ExtractFilePath(paramstr(0))+'data';
if FileExists(DataPath+'Local.rar') then
begin
iFileHandle:=FileOpen(DataPath+'LocalDataBase.rar', fmOpenRead);
FileTime := FileDateToDateTime(FileGetDate(iFileHandle));
FileClose(iFileHandle);
Days := DaysBetween(now,FileTime);
Hours:=HoursBetween(now,FileTime)-(Days * 24);
Minutes := MinutesBetween(now,FileTime)-((Days * 24 + Hours) * 60);
Seconds := SecondsBetween(now,FileTime)-(((Days * 24 + Hours)*60+Minutes) * 60);
Label1.Caption:='最后修改时间:'+
IntToStr(Days)+' 天'+
IntToStr(Hours)+' 小时'+
IntToStr(Minutes)+' 分'+
IntToStr(Seconds)+' 秒之前';
end;
end;
var
iFileHandle: Integer;
FileTime:TDateTime;
Days:Integer;
Hours:Integer;
Minutes:Integer;
Seconds:Integer;
begin
DataPath := ExtractFilePath(paramstr(0))+'data';
if FileExists(DataPath+'Local.rar') then
begin
iFileHandle:=FileOpen(DataPath+'LocalDataBase.rar', fmOpenRead);
FileTime := FileDateToDateTime(FileGetDate(iFileHandle));
FileClose(iFileHandle);
Days := DaysBetween(now,FileTime);
Hours:=HoursBetween(now,FileTime)-(Days * 24);
Minutes := MinutesBetween(now,FileTime)-((Days * 24 + Hours) * 60);
Seconds := SecondsBetween(now,FileTime)-(((Days * 24 + Hours)*60+Minutes) * 60);
Label1.Caption:='最后修改时间:'+
IntToStr(Days)+' 天'+
IntToStr(Hours)+' 小时'+
IntToStr(Minutes)+' 分'+
IntToStr(Seconds)+' 秒之前';
end;
end;
- delphi 计算文件与当前时间差(天小时分钟秒)
- delphi 计算文件与当前时间差(天小时分钟秒)
- Js计算时间差(天、小时、分钟、秒)
- NET计算时间差(天、小时、分钟、秒)
- Js计算时间差(天、小时、分钟、秒)
- Js计算时间差(天、小时、分钟、秒)
- Js计算时间差(天、小时、分钟、秒)
- js求时间差 计算 天 小时 分钟
- Oracle 计算两个日期之间的时间差(天/小时/分钟/秒)
- 小时 分钟 秒 计算
- iOS 前端与后台服务器时间差的计算并转化为天、小时、分钟
- JAVA计算创建时间与当前时间差(天,时,分,秒)
- 计算指定时间与当前的时间差 比如,3天前、10分钟前
- 计算指定时间与当前的时间差 比如,3天前、10分钟前
- 计算指定时间与当前的时间差 比如,3天前、10分钟前
- 计算指定时间与当前的时间差 比如,3天前、10分钟前
- 计算指定时间与当前的时间差 比如,3天前、10分钟前
- 计算指定时间与当前的时间差 比如,3天前、10分钟前
- Oracle Mix, Powered by JRuby on Rails
- 馒头渣!
- WinHttp.WinHttpRequest.5.1
- 使用Cookie存取少量数据
- javascript 调用 样式表 样式名称
- delphi 计算文件与当前时间差(天小时分钟秒)
- 采用多播传送FIX行情数据的推荐方案
- Symbian游戏编程入门 (一) Symbian OS简介
- 委托和事件
- printf格式控制符的完整格式
- admin package
- 轻松使用蓝牙篇实现PDA无线上网
- GridView删除数据时索引超出范围的解决方法
- eclipse