var
datetime1, datetime2: Tdatetime;
year,month,day,h,m,s,ms: word ;
begin... ...decodedate(datetime2-datetime1,year,month,day);
//将两日期相隔数的年月日分离出来
decodetime(datetime2-datetime1,h,m,s,ms);
//将两日期相隔数的时分秒、毫秒分离出来
caption:=datetimetostr(datetime2-datetime1);
//将两日期相隔数显示出来
datetime1, datetime2: Tdatetime;
year,month,day,h,m,s,ms: word ;
begin... ...decodedate(datetime2-datetime1,year,month,day);
//将两日期相隔数的年月日分离出来
decodetime(datetime2-datetime1,h,m,s,ms);
//将两日期相隔数的时分秒、毫秒分离出来
caption:=datetimetostr(datetime2-datetime1);
//将两日期相隔数显示出来
解决方案 »
- 为什么delphi7 比DELPHI2007的编译速度差那么多?
- label 字体间距如何动态设置
- 如何使用timer 让程序每隔几秒钟就查询数据库一次?
- 关于TComboBox
- 我有30个文本文件需要合并成一个新的文本文件,用什么方法最好?
- 计算机自学考试选择哪门专业好(信息管理专业、网络、软件、计算机及应用专业)?上海哪里有业余时间的辅导班?
- 请问如何用tts将文本保存为wav格式?
- 关于窗口选用字体的问题!?
- 关于单选按钮的一个问题
- Delphi 的奇异之处!!!送100分,大家来看看!!!!
- 我怎么才能把delphi专题下的所有文章下载到本地
- 求Delphi xxGrid中可以自由定义行或Cell颜色的免费控件
var Y, M, D, H, Mi, S, Ms: Word);
var
DateTime3: TDateTime;
begin
DateTime3 := Abs(DateTime1 - DateTime2);
DecodeDate(DateTime3, Y, M, D);
DecodeTime(DateTime3, H, Mi, S, Ms);
end;