Java tutorial
//package com.java2s; import java.util.Calendar; public class Main { public static String getDateYYYYMM(int offset) { Calendar calendar = Calendar.getInstance(); calendar.add(Calendar.MONTH, offset); return calendar.get(Calendar.YEAR) + "-" + calendar.get(Calendar.MONTH); } }