// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.util.*;
import java.text.*;

public class MonthsBack {
   private final static DateFormat df = new SimpleDateFormat("yyyyMM");
   public static String mminus(String t, int m) throws ParseException {
      Calendar c = new GregorianCalendar();
      c.setTime(df.parse(t));
      c.add(Calendar.MONTH, -m);
      return df.format(c.getTime());
   }
   public static void main(String[] args) throws Exception {
      System.out.println(mminus("200309",11));
   }
}
