Here you can find the source of getYearLater()
public static Date getYearLater()
//package com.java2s; //License from project: Apache License import java.sql.Date; import java.util.Calendar; public class Main { /**/* w w w. ja v a 2s . c om*/ * get date for a year later * @return Date: * @throws */ public static Date getYearLater() { Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.YEAR, calendar.get(Calendar.YEAR) + 1); Date date = new Date(calendar.getTimeInMillis()); return date; } /** * * get date a year after date given * @param date * @return * Date * @throws */ public static Date getYearLater(Date date) { Calendar calendar = Calendar.getInstance(); calendar.setTime(date); calendar.set(Calendar.YEAR, calendar.get(Calendar.YEAR) + 1); Date date2 = new Date(calendar.getTimeInMillis()); return date2; } }