Java Date Before getBefore(Date date)

Here you can find the source of getBefore(Date date)

Description

get Before

License

Apache License

Declaration

public static Date getBefore(Date date) 

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 getBefore(Date date) {
        return getBefore(date, -1);
    }/*from   w w w.j  av a 2 s  .co  m*/

    public static Date getBefore(Date date, int off) {
        Calendar cal = Calendar.getInstance();
        cal.setTime(date);
        cal.add(Calendar.DATE, off);
        return cal.getTime();
    }
}

Related

  1. before(Date sDate, Date eDate)
  2. beforeDay(final Date date1, final Date date2)
  3. beforeDays(Date date, Integer days)
  4. beforeTime(Date time1, Date time2)
  5. daysBefore(Date date1)
  6. getBeforeDate(final int unit, final int period)
  7. getBeforeDate(String range)
  8. getBeforeHourByCurrentTime(Date now, int mount)
  9. getBeforeOrAfterDateByDayNumber(int dayNumber)