关于DELPHI计算月份的问题。高手帮忙啊

[复制链接]
查看11 | 回复1 | 2007-4-26 08:33:09 | 显示全部楼层 |阅读模式
if copy(month,5,2)='01' thenmonth:=inttostr(strtoint(copy(month,1,4))-1)+'12'elsemonth:=copy(month,1,4)+formatfloat('00',strtoint(copy(month,5,2))-1);
回复

使用道具 举报

千问 | 2007-4-26 08:33:09 | 显示全部楼层
function prvmonth(ADatetime : Tdatetime) : Tdatetime;varyear,month,day: wordbegindecodedate(Adatetime,year,month,day);if month = 1 thenbegin
Year := year - 1;
month := 12;end else
Month := Month - 1;
Result := Encodedate(year,month,day);end;
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行