Here you can find the source of getIndexYear(Date origin, int index)
public static Date getIndexYear(Date origin, int index)
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { public static Date getIndexYear(Date origin, int index) { Date dt = origin;/*from w ww . ja va 2s . co m*/ Calendar rightNow = Calendar.getInstance(); rightNow.setTime(dt); rightNow.add(Calendar.YEAR, index); Date dt1 = rightNow.getTime(); return dt1; } }