Android Year Get getIndexYear(Date origin, int index)

Here you can find the source of getIndexYear(Date origin, int index)

Description

get Index Year

Declaration

public static Date getIndexYear(Date origin, int index) 

Method Source Code

//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;
    }
}

Related

  1. getCurrentYear()
  2. getCurrentYear()
  3. getCurrentYear()
  4. getBeforeYear()