Here you can find the source of getMonthByOffset(Date date, int offset)
public static Date getMonthByOffset(Date date, int offset)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static Date getMonthByOffset(Date date, int offset) { Calendar calendar = Calendar.getInstance(); if (null != date) { calendar.setTime(date);//w w w .java 2s. c om calendar.set(5, 1); calendar.set(11, 0); calendar.set(12, 0); calendar.set(13, 0); calendar.set(14, 0); } calendar.add(2, offset); return calendar.getTime(); } }