怎么算得一个比某个时间多N分钟的TDateTime 比如,在2009-1-1 18:00:00.000 加15分钟,返回2009-1-1 18:15:00.000,依此类推。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 tdatetime其实就是double,1表示1天,因此1分钟就是1/(24×60)加N分钟就把时间加上N/(24×60) Delphi里有现成的函数可以实现日期加减,在DateUtils单元里的。 function IncYear(const AValue: TDateTime;const ANumberOfYears: Integer = 1): TDateTime;// function IncMonth is in SysUtilsfunction IncWeek(const AValue: TDateTime;const ANumberOfWeeks: Integer = 1): TDateTime;function IncDay(const AValue: TDateTime;const ANumberOfDays: Integer = 1): TDateTime;function IncHour(const AValue: TDateTime;const ANumberOfHours: Int64 = 1): TDateTime;function IncMinute(const AValue: TDateTime;const ANumberOfMinutes: Int64 = 1): TDateTime;function IncSecond(const AValue: TDateTime;const ANumberOfSeconds: Int64 = 1): TDateTime;function IncMilliSecond(const AValue: TDateTime;const ANumberOfMilliSeconds: Int64 = 1): TDateTime; IncMinute( ) 就是分钟加减 procedure TForm1.Button1Click(Sender: TObject);begin ShowMessage(DateTimeToStr(IncMinute(now,15)));end; 有免费用于Delphi2010的可以快速导出Excel文件的控件吗? 渐渐的喜欢上零晨1,2点的感觉 图象 一元方程的画图 100分 怎样做屏保安装程序? Delphi问题5:添加SQL语句出错? 高分: 寻找能直接录音成MP3的DELPHI控件!!! 关于数据表的问题!(在线等...) 线程异常问题 where子句后面条件格式是什么?例如and between or 最好分别写个例子,多多谢 Borland Delphi6和Jbuilder5技术研讨会。成都 delphi ado sql, 2个数据库 mdb,结构相同,复制表中的部分或全部数据 主窗体新建一窗体的问题,创建后 焦点的问题
加N分钟就把时间加上N/(24×60)
begin
ShowMessage(DateTimeToStr(IncMinute(now,15)));
end;