计算出Datetimepicker1、2两个控件的时间差 请问在一模块中使用了3个控件分别为:Datetimepicker1、Datetimepicker和Edit1。现在想计算出Datetimepicker1、2两个控件的时间差并显示在Edit1控件中(以‘分钟’或者‘小时’为单位显示),该如何写代码? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 时间相减,结果是Double的处理一下就是的,这些基础问题Google随时能找到答案的_____________________http://lysoft.7u7.net DateTimePicker1.DateTime-DateTimePicker2.DateTime得出的结果 是多少天乘24是小时再乘60是分再乘60是秒 user DateUtilsfunction YearsBetween(const ANow, AThen: TDateTime): Integer;function MonthsBetween(const ANow, AThen: TDateTime): Integer;function WeeksBetween(const ANow, AThen: TDateTime): Integer;function DaysBetween(const ANow, AThen: TDateTime): Integer;function HoursBetween(const ANow, AThen: TDateTime): Int64;function MinutesBetween(const ANow, AThen: TDateTime): Int64;function SecondsBetween(const ANow, AThen: TDateTime): Int64;function MilliSecondsBetween(const ANow, AThen: TDateTime): Int64; hellolongbin(一个人[终不似 少年游]) 说的没有错得到小时Edit1.text:=inttostr(trunc((DateTimePicker1.DateTime-DateTimePicker2.DateTime)*24));得到分钟Edit1.text:=inttostr(trunc((DateTimePicker1.DateTime-DateTimePicker2.DateTime)*24*60)); 如何解析HTML文件? C中的Char数组,对应在delphi中该如何写呀? 关于cxgrid的两个问题,请大家帮帮忙 高分跑求购身份证扫描识别控件 急急急 !!求助! 用过virtualtree的朋友进来看看! 如何使一個窗體總在所有的應用程式的最前面. 我 VS 联想 小弟做一个程序!怎样用代码实现access数据库的导入!和怎样把sql语句选择出来的数据导出到access!在线等! 我想将另一窗口的几个数据加入到报表中,应该用什么控件,怎么加? 这里有没有人玩MUD呀,谁知道哪里有客户端的源程序呀 如何把焦点移到上一控件? 如何将DBGrid中的数据直接导出到Excel表中
处理一下就是的,这些基础问题Google随时能找到答案的_____________________
http://lysoft.7u7.net
得出的结果 是多少天
乘24是小时
再乘60是分
再乘60是秒
function MonthsBetween(const ANow, AThen: TDateTime): Integer;
function WeeksBetween(const ANow, AThen: TDateTime): Integer;
function DaysBetween(const ANow, AThen: TDateTime): Integer;
function HoursBetween(const ANow, AThen: TDateTime): Int64;
function MinutesBetween(const ANow, AThen: TDateTime): Int64;
function SecondsBetween(const ANow, AThen: TDateTime): Int64;
function MilliSecondsBetween(const ANow, AThen: TDateTime): Int64;
得到小时
Edit1.text:=inttostr(trunc((DateTimePicker1.DateTime-DateTimePicker2.DateTime)*24));
得到分钟
Edit1.text:=inttostr(trunc((DateTimePicker1.DateTime-DateTimePicker2.DateTime)*24*60));