Y yorkjj Unregistered / Unconfirmed GUEST, unregistred user! 2007-05-21 #1 比如说现在是200705如果我加上12就变成了200805 或者加上2就变成了200707
S songrun Unregistered / Unconfirmed GUEST, unregistred user! 2007-05-21 #2 dateadd(month,12,year_month_no); dateadd(month,2,year_month_no);
K kaida Unregistered / Unconfirmed GUEST, unregistred user! 2007-05-21 #3 function StrIncMonth(ID: string; NumberOfMonths: word): string; var year,month: word; aDate: TDate; begin year:=strtoint(copy(ID,1,4)); month:=strtoint(copy(ID,5,2)); aDate:=EncodeDate(year,month,1); aDate:=IncMonth(aDate, NumberOfMonths); result:=FormatDateTime('YYYYMM', aDate); end;
function StrIncMonth(ID: string; NumberOfMonths: word): string; var year,month: word; aDate: TDate; begin year:=strtoint(copy(ID,1,4)); month:=strtoint(copy(ID,5,2)); aDate:=EncodeDate(year,month,1); aDate:=IncMonth(aDate, NumberOfMonths); result:=FormatDateTime('YYYYMM', aDate); end;