Here you can find the source of moveToDate(int field, int amount)
public static Date moveToDate(int field, int amount)
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { public static Date moveToDate(int field, int amount) { Calendar calendar = Calendar.getInstance(); calendar.setTime(new Date()); calendar.add(field, amount);//from ww w .j av a 2 s . c o m return calendar.getTime(); } }