Java Date Subtract subtractCertainYears(java.util.Date date, Integer years)

Here you can find the source of subtractCertainYears(java.util.Date date, Integer years)

Description

subtract Certain Years

License

Open Source License

Declaration

public static java.util.Date subtractCertainYears(java.util.Date date, Integer years) 

Method Source Code

//package com.java2s;

import java.util.Calendar;

public class Main {

    public static java.util.Date subtractCertainYears(java.util.Date date, Integer years) {
        java.util.Calendar cal = Calendar.getInstance();
        cal.setTime(date);/*www .  j a  va2  s  .co  m*/
        cal.add(Calendar.YEAR, -years);
        return cal.getTime();
    }
}

Related

  1. substractDaysFromDate(final Date date, final int substractDays)
  2. subtract(Date date, int num)
  3. subtractDate(Date date, int type, Integer quantity)
  4. subtractDate(Date date, int type, Integer quantity)
  5. subtractDay(final Date date)
  6. subtractDays(Date dt, int days)