Java Date Previous getPreviousDate(Date date)

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

Description

Get the previous date

License

Open Source License

Parameter

Parameter Description
date a parameter

Return

Date

Declaration

public static Date getPreviousDate(Date date) 

Method Source Code

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

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

public class Main {
    /**//www.  j  av a 2s.  co m
     * Get the previous date
     * 
     * @author Randy Wong
     * @param date
     * @return Date
     */
    public static Date getPreviousDate(Date date) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);
        calendar.add(java.util.Calendar.DAY_OF_YEAR, -1);
        return calendar.getTime();
    }
}

Related

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