Java Date Subtract subtract(Date date, int num)

Here you can find the source of subtract(Date date, int num)

Description

subtract

License

Apache License

Declaration

public static Date subtract(Date date, int num) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Calendar;
import java.util.Date;

public class Main {
    public static Date subtract(Date date, int num) {
        Calendar canlendar = Calendar.getInstance();
        canlendar.setTime(date);/*from  www  .j a v a  2  s .co  m*/
        canlendar.add(Calendar.DATE, -num);
        return canlendar.getTime();
    }
}

Related

  1. substractDaysFromDate(final Date date, final int substractDays)
  2. subtractCertainYears(java.util.Date date, Integer years)
  3. subtractDate(Date date, int type, Integer quantity)
  4. subtractDate(Date date, int type, Integer quantity)
  5. subtractDay(final Date date)