上个月

mStrMonth:=copy(lstarttime, 6, 1);
if copy(lstarttime, 6, 1)='0' then
begin
    if copy(lstarttime, 7, 1)='1' then
    begin
      mStrMonth:=IntToStr( StrToInt(copy(lstarttime, 1, 4))- 1 )+'-12'
    end
    else
    begin
      mStrMonth:=copy(lstarttime, 1, 6)+inttostr(strtoint(copy(lstarttime, 7, 1))-1)

原文地址:https://www.cnblogs.com/martian6125/p/9631443.html