Java Date Previous getPrevDay(Date date)

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

Description

get Prev Day

License

Open Source License

Declaration

public static Date getPrevDay(Date date) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

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

public class Main {

    public static Date getPrevDay(Date date) {
        if (date == null) {
            throw new NullPointerException();
        }/*  w  w  w .ja va  2 s  .  c o m*/
        Calendar calendar = new GregorianCalendar();
        calendar.setTime(date);
        calendar.add(Calendar.DAY_OF_YEAR, -1);
        return calendar.getTime();
    }
}

Related

  1. getPreDay(Date date)
  2. getPrefixStartDate(Integer day)
  3. GetPreMonthBeginDate()
  4. getPreMonthDate(Date date, int month)
  5. getPrevDueDate(int payperiod, long time)
  6. getPreviousDate(Date date)
  7. getPreviousDate(final Date date)
  8. getPreviousDate(int period)