delphi 日期加减


本文整理自网络,侵删。

 
function AddDays(const DateTime: TDateTime; const Days: Integer): TDateTime;
begin
  Result := DateTime + Days;
end;

function SubtractDays(const DateTime: TDateTime; const Days: Integer): TDateTime;
begin
  Result := DateTime - Days;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
caption:=datetimetostr(AddDays(date,1)); //加1天
caption:=datetimetostr(SubtractDays(date,1));  //减1天
end;

相关阅读 >>

webbrower常见问题及解决方法

Delphi tfont类型和json互相转换的函数

Delphi计算两个时间差

Delphi一句话复制整个文件夹(当然包括嵌套文件夹)

Delphi 两个exe之间共享数据

Delphi 的内存操作函数(4): 清空与填充内存

Delphi中实现调整图像的色阶的算法

Delphi xe5读取android imei id

Delphi xe10 android安卓 移动端 messagedlg 用法

Delphi获得系统当前时间日期和格式化时间

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...