Here you can find the source of getDateFormOffset(int months, int days, int hours, int minutes)
public static Calendar getDateFormOffset(int months, int days, int hours, int minutes)
//package com.java2s; import java.util.Calendar; public class Main { public static Calendar getDateFormOffset(int months, int days, int hours, int minutes) { Calendar selectedDate = getCurrentDate(); selectedDate.add(Calendar.DAY_OF_MONTH, days); selectedDate.add(Calendar.MONTH, months); selectedDate.add(Calendar.HOUR_OF_DAY, hours); selectedDate.add(Calendar.MINUTE, minutes); return selectedDate; }//from w w w . j av a 2 s .c o m public static Calendar getCurrentDate() { Calendar currDate = Calendar.getInstance(); currDate.setTimeInMillis(System.currentTimeMillis()); currDate.set(Calendar.MONTH, currDate.get(Calendar.MONTH) + 1); return currDate; } }