定义一个日期字段tdate,k:=2002-1-1;怎样实行月加1,变成,2002-2-1 定义一个日期字段tdate,k:=2002-1-1;怎样实行月加1,变成,2002-2-1 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用IncMonth函数function IncMonth(const Date: TDateTime; NumberOfMonths: Integer): TDateTime;NumberOfMonths为正是增加月份,为付是减少月份。关于日期的操作,可以查看Delphi Help中的TDateTime type.incmonth(yourdate,+1)例:vartheday:Tdate;str:string;begin theday:=encodedate(2000,5,31); //获得日期‘2000-5-31’ theday:=incmonth(theday,+1); str:= datetostr(theday); form1.Canvas.TextOut(100,100,str);end; 请查阅EncodeDate及DecodeDate函数,你就知道了 cg1120(代码最优化-§新年祝福你,好运伴着你) 说的是一种方法,如果是在数据库中的话还有一个func 就可以实现的. webbrowser遍历Form的问题 MsComm控件 如何设置流控制 函数返回类型为String?这样的格式如何解析? DBGRID如何判断是否有一行被选中? 程序主窗体代码太多,分离出去为函数,有什么办法! 提供酒店管理源代码 请教大家一个问题,请关注。 有关access的日期变量 请教查询统计的SQL语句??? socket高手进来...socket编程中有几种传输文件的方式? 一个小问题 再问一个:如何获取窗体标题栏的高度?
function IncMonth(const Date: TDateTime; NumberOfMonths: Integer): TDateTime;
NumberOfMonths为正是增加月份,为付是减少月份。
关于日期的操作,可以查看Delphi Help中的TDateTime type.incmonth(yourdate,+1)例:
var
theday:Tdate;
str:string;
begin
theday:=encodedate(2000,5,31); //获得日期‘2000-5-31’
theday:=incmonth(theday,+1);
str:= datetostr(theday);
form1.Canvas.TextOut(100,100,str);
end;