Java tutorial
//package com.java2s; import java.util.Calendar; public class Main { public static int getDayOfMonth(int offset) { Calendar calendar = Calendar.getInstance(); calendar.add(Calendar.MONTH, offset); return calendar.get(Calendar.DAY_OF_MONTH); } }